diff options
Diffstat (limited to 'drivers/spi/spi-coldfire-qspi.c')
-rw-r--r-- | drivers/spi/spi-coldfire-qspi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 7b5cc9e4e94d..f99943bf3519 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c | |||
@@ -408,6 +408,12 @@ static int mcfqspi_probe(struct platform_device *pdev) | |||
408 | struct mcfqspi_platform_data *pdata; | 408 | struct mcfqspi_platform_data *pdata; |
409 | int status; | 409 | int status; |
410 | 410 | ||
411 | pdata = pdev->dev.platform_data; | ||
412 | if (!pdata) { | ||
413 | dev_dbg(&pdev->dev, "platform data is missing\n"); | ||
414 | return -ENOENT; | ||
415 | } | ||
416 | |||
411 | master = spi_alloc_master(&pdev->dev, sizeof(*mcfqspi)); | 417 | master = spi_alloc_master(&pdev->dev, sizeof(*mcfqspi)); |
412 | if (master == NULL) { | 418 | if (master == NULL) { |
413 | dev_dbg(&pdev->dev, "spi_alloc_master failed\n"); | 419 | dev_dbg(&pdev->dev, "spi_alloc_master failed\n"); |
@@ -458,11 +464,6 @@ static int mcfqspi_probe(struct platform_device *pdev) | |||
458 | } | 464 | } |
459 | clk_enable(mcfqspi->clk); | 465 | clk_enable(mcfqspi->clk); |
460 | 466 | ||
461 | pdata = pdev->dev.platform_data; | ||
462 | if (!pdata) { | ||
463 | dev_dbg(&pdev->dev, "platform data is missing\n"); | ||
464 | goto fail4; | ||
465 | } | ||
466 | master->bus_num = pdata->bus_num; | 467 | master->bus_num = pdata->bus_num; |
467 | master->num_chipselect = pdata->num_chipselect; | 468 | master->num_chipselect = pdata->num_chipselect; |
468 | 469 | ||