aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap2-mcspi.c
diff options
context:
space:
mode:
authorShubhrajyoti D <shubhrajyoti@ti.com>2012-08-02 07:11:25 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-04 07:06:47 -0400
commit37a2d84a38df16e614bbfbb18a5155ebd8256938 (patch)
tree9bdcffa4d86319e77c33ba9e21c24dde9cd743e7 /drivers/spi/spi-omap2-mcspi.c
parent10ce0473e0de3ff8c091735f85c20fceace061cd (diff)
spi: omap2-mcspi: Fix the error handling in probe
The kfree() is taken care of by the spi core (spi_master_release() function) that is called once the last reference to the underlying struct device has been released. So the driver need not call kfree. Also the put was missed in some of the error handling fix the same. There by fixing the missing device_put in some of the error paths. Acked-by: Guenter Roeck <linux@roeck-us.net> Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/spi/spi-omap2-mcspi.c')
-rw-r--r--drivers/spi/spi-omap2-mcspi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index bc4778175e34..b2fb141da375 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1228,18 +1228,16 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
1228 1228
1229 status = spi_register_master(master); 1229 status = spi_register_master(master);
1230 if (status < 0) 1230 if (status < 0)
1231 goto err_spi_register; 1231 goto disable_pm;
1232 1232
1233 return status; 1233 return status;
1234 1234
1235err_spi_register:
1236 spi_master_put(master);
1237disable_pm: 1235disable_pm:
1238 pm_runtime_disable(&pdev->dev); 1236 pm_runtime_disable(&pdev->dev);
1239dma_chnl_free: 1237dma_chnl_free:
1240 kfree(mcspi->dma_channels); 1238 kfree(mcspi->dma_channels);
1241free_master: 1239free_master:
1242 kfree(master); 1240 spi_master_put(master);
1243 platform_set_drvdata(pdev, NULL); 1241 platform_set_drvdata(pdev, NULL);
1244 return status; 1242 return status;
1245} 1243}