summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-mxic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-mxic.c')
-rw-r--r--drivers/spi/spi-mxic.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
index 8c630acb0110..96b418293bf2 100644
--- a/drivers/spi/spi-mxic.c
+++ b/drivers/spi/spi-mxic.c
@@ -529,7 +529,7 @@ static int mxic_spi_probe(struct platform_device *pdev)
struct mxic_spi *mxic;
int ret;
- master = spi_alloc_master(&pdev->dev, sizeof(struct mxic_spi));
+ master = devm_spi_alloc_master(&pdev->dev, sizeof(struct mxic_spi));
if (!master)
return -ENOMEM;
@@ -574,15 +574,9 @@ static int mxic_spi_probe(struct platform_device *pdev)
ret = spi_register_master(master);
if (ret) {
dev_err(&pdev->dev, "spi_register_master failed\n");
- goto err_put_master;
+ pm_runtime_disable(&pdev->dev);
}
- return 0;
-
-err_put_master:
- spi_master_put(master);
- pm_runtime_disable(&pdev->dev);
-
return ret;
}