aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2012-07-10 19:40:56 -0400
committerChris Ball <cjb@laptop.org>2012-07-22 16:42:47 -0400
commit9c17d08ca183b92c9cfab6537069914a5e0e7e81 (patch)
treeda0aee25b520a6900fbcc3fd6fff2287c08adeef /drivers/mmc
parentb6e76f10afbdc510df9288ab4df3e94a89c20909 (diff)
mmc: omap_hsmmc: ensure probe returns error upon resource failure
If platform_get_resource_by_name() fails, driver probe is aborted an should return an error so the driver is not bound to the device. However, in the current error path of platform_get_resource_by_name(), probe returns zero since the return value (ret) is not properly set. With a zero return value, the driver core assumes probe was successful and will bind the driver to the device. Fix this by ensuring that probe returns an error code in this failure path. Signed-off-by: Kevin Hilman <khilman@ti.com> Acked-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index a9227a7a9d69..bc28627af66b 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1931,6 +1931,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
1931 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); 1931 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx");
1932 if (!res) { 1932 if (!res) {
1933 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); 1933 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n");
1934 ret = -ENXIO;
1934 goto err_irq; 1935 goto err_irq;
1935 } 1936 }
1936 host->dma_line_tx = res->start; 1937 host->dma_line_tx = res->start;
@@ -1938,6 +1939,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
1938 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); 1939 res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx");
1939 if (!res) { 1940 if (!res) {
1940 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); 1941 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n");
1942 ret = -ENXIO;
1941 goto err_irq; 1943 goto err_irq;
1942 } 1944 }
1943 host->dma_line_rx = res->start; 1945 host->dma_line_rx = res->start;