summaryrefslogtreecommitdiffstats
path: root/drivers/mci
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-07-31 10:38:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-09-16 08:32:10 +0200
commited6e965824303255cacc1c1a195d3684caa26bce (patch)
tree26e2b1b78498675ceae4dd2e990836c26ec1d5ec /drivers/mci
parent5bdc82c54a3306f2ae151a00f2df54f9240395b8 (diff)
downloadbarebox-ed6e965824303255cacc1c1a195d3684caa26bce.tar.gz
barebox-ed6e965824303255cacc1c1a195d3684caa26bce.tar.xz
resource: Let dev_request_mem_region return an error pointer
For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci')
-rw-r--r--drivers/mci/atmel_mci.c2
-rw-r--r--drivers/mci/dw_mmc.c4
-rw-r--r--drivers/mci/imx-esdhc.c2
-rw-r--r--drivers/mci/imx.c2
-rw-r--r--drivers/mci/mci-bcm2835.c5
-rw-r--r--drivers/mci/mxs.c2
-rw-r--r--drivers/mci/omap_hsmmc.c3
-rw-r--r--drivers/mci/pxamci.c3
-rw-r--r--drivers/mci/s3c.c4
-rw-r--r--drivers/mci/tegra-sdmmc.c5
10 files changed, 26 insertions, 6 deletions
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 36107a6ef8..63d2475da7 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -572,6 +572,8 @@ static int atmci_probe(struct device_d *hw_dev)
host->slot_b = pd->slot_b;
host->regs = dev_request_mem_region(hw_dev, 0);
+ if (IS_ERR(host->regs))
+ return PTR_ERR(host->regs);
host->hw_dev = hw_dev;
hw_dev->priv = host;
host->clk = clk_get(hw_dev, "mci_clk");
diff --git a/drivers/mci/dw_mmc.c b/drivers/mci/dw_mmc.c
index 4c2f3c616b..365b60d6d4 100644
--- a/drivers/mci/dw_mmc.c
+++ b/drivers/mci/dw_mmc.c
@@ -547,8 +547,8 @@ static int dw_mmc_probe(struct device_d *dev)
host->dev = dev;
host->ioaddr = dev_request_mem_region(dev, 0);
- if (!host->ioaddr)
- return -EBUSY;
+ if (IS_ERR(host->ioaddr))
+ return PTR_ERR(host->ioaddr);
if (pdata) {
mci->devname = pdata->devname;
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index f5e78e0d79..487cd41958 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -536,6 +536,8 @@ static int fsl_esdhc_probe(struct device_d *dev)
host->dev = dev;
host->regs = dev_request_mem_region(dev, 0);
+ if (IS_ERR(host->regs))
+ return PTR_ERR(host->regs);
/* First reset the eSDHC controller */
ret = esdhc_reset(host->regs);
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c
index 6992177af6..9c8c1b1e27 100644
--- a/drivers/mci/imx.c
+++ b/drivers/mci/imx.c
@@ -508,6 +508,8 @@ static int mxcmci_probe(struct device_d *dev)
host->mci.hw_dev = dev;
host->base = dev_request_mem_region(dev, 0);
+ if (IS_ERR(host->base))
+ return PTR_ERR(host->base);
host->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c
index 7d8997c04c..59c667f5c9 100644
--- a/drivers/mci/mci-bcm2835.c
+++ b/drivers/mci/mci-bcm2835.c
@@ -35,6 +35,7 @@
#include <malloc.h>
#include <clock.h>
#include <linux/clk.h>
+#include <linux/err.h>
#include "mci-bcm2835.h"
#include "sdhci.h"
@@ -505,9 +506,9 @@ static int bcm2835_mci_probe(struct device_d *hw_dev)
host->hw_dev = hw_dev;
host->max_clock = clk_get_rate(clk);
host->regs = dev_request_mem_region(hw_dev, 0);
- if (host->regs == NULL) {
+ if (IS_ERR(host->regs)) {
dev_err(host->hw_dev, "Failed request mem region, aborting...\n");
- return -EBUSY;
+ return PTR_ERR(host->regs);
}
host->mci.host_caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SD_HIGHSPEED |
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index bf928e80ff..6e02d464b4 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -566,6 +566,8 @@ static int mxs_mci_probe(struct device_d *hw_dev)
host->set_ios = mxs_mci_set_ios;
host->init = mxs_mci_initialize;
mxs_mci->regs = dev_request_mem_region(hw_dev, 0);
+ if (IS_ERR(mxs_mci->regs))
+ return PTR_ERR(mxs_mci->regs);
/* feed forward the platform specific values */
host->voltages = pd->voltages;
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 9cce916923..c9bc71d6c0 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -26,6 +26,7 @@
#include <clock.h>
#include <errno.h>
#include <io.h>
+#include <linux/err.h>
#include <mach/omap_hsmmc.h>
@@ -604,6 +605,8 @@ static int omap_mmc_probe(struct device_d *dev)
hsmmc->mci.hw_dev = dev;
hsmmc->iobase = dev_request_mem_region(dev, 0);
+ if (IS_ERR(hsmmc->iobase))
+ return PTR_ERR(hsmmc->iobase);
hsmmc->base = hsmmc->iobase + reg_ofs;
hsmmc->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
diff --git a/drivers/mci/pxamci.c b/drivers/mci/pxamci.c
index 5ab88b8beb..6b14aba509 100644
--- a/drivers/mci/pxamci.c
+++ b/drivers/mci/pxamci.c
@@ -17,6 +17,7 @@
#include <clock.h>
#include <init.h>
#include <mci.h>
+#include <linux/err.h>
#include <mach/clock.h>
#include <mach/mci_pxa2xx.h>
@@ -339,6 +340,8 @@ static int pxamci_probe(struct device_d *dev)
clk_enable();
host = xzalloc(sizeof(*host));
host->base = dev_request_mem_region(dev, 0);
+ if (IS_ERR(host->base))
+ return PTR_ERR(host->base);
host->mci.init = pxamci_init;
host->mci.send_cmd = pxamci_request;
diff --git a/drivers/mci/s3c.c b/drivers/mci/s3c.c
index 773c84ad09..3afd61e491 100644
--- a/drivers/mci/s3c.c
+++ b/drivers/mci/s3c.c
@@ -36,6 +36,7 @@
#include <errno.h>
#include <clock.h>
#include <io.h>
+#include <linux/err.h>
#include <mach/s3c-mci.h>
#include <mach/s3c-generic.h>
#include <mach/s3c-iomap.h>
@@ -741,6 +742,9 @@ static int s3c_mci_probe(struct device_d *hw_dev)
hw_dev->priv = s3c_host;
s3c_host->base = dev_request_mem_region(hw_dev, 0);
+ if (IS_ERR(s3c_host->base))
+ return PTR_ERR(s3c_host->base);
+
s3c_host->host.hw_dev = hw_dev;
/* feed forward the platform specific values */
diff --git a/drivers/mci/tegra-sdmmc.c b/drivers/mci/tegra-sdmmc.c
index 08b9dac7d3..0e23d6fef1 100644
--- a/drivers/mci/tegra-sdmmc.c
+++ b/drivers/mci/tegra-sdmmc.c
@@ -29,6 +29,7 @@
#include <of_gpio.h>
#include <linux/clk.h>
#include <linux/reset.h>
+#include <linux/err.h>
#include "sdhci.h"
@@ -432,9 +433,9 @@ static int tegra_sdmmc_probe(struct device_d *dev)
return PTR_ERR(host->reset);
host->regs = dev_request_mem_region(dev, 0);
- if (!host->regs) {
+ if (IS_ERR(host->regs)) {
dev_err(dev, "could not get iomem region\n");
- return -ENODEV;
+ return PTR_ERR(host->regs);
}
mci->hw_dev = dev;