aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-19 14:36:13 +0900
committerKukjin Kim <kgene.kim@samsung.com>2012-07-19 14:36:13 +0900
commit49f3eacfcdab2e1cd381dc8e820bb6840787be00 (patch)
treec54f314c09e604ec091c383926c8b0f3de97e34a /drivers/spi
parentMerge branch 'next/dt-samsung' into next/devel-samsung-spi (diff)
downloadlinux-dev-49f3eacfcdab2e1cd381dc8e820bb6840787be00.tar.xz
linux-dev-49f3eacfcdab2e1cd381dc8e820bb6840787be00.zip
spi/s3c64xx: Fix handling of errors in gpio_request()
When gpio_request() fails the driver logged the failure but while it'd try to print an error code in the non-DT case it didn't pass the error code in so garbage would be logged and in the DT case the error wasn't logged. Further, in the non-DT case the error code was then overwritten with -EBUSY depriving the caller of information and breaking automatic probe deferral pushing back from the GPIO level. Also reformat the non-DT log message so it's not word wrapped and we can grep for it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-s3c64xx.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 0dedbbdb153a..0bec10b7e6c0 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -896,9 +896,9 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
if (!spi_get_ctldata(spi)) {
err = gpio_request(cs->line, dev_name(&spi->dev));
if (err) {
- dev_err(&spi->dev, "request for slave select gpio "
- "line [%d] failed\n", cs->line);
- err = -EBUSY;
+ dev_err(&spi->dev,
+ "Failed to get /CS gpio [%d]: %d\n",
+ cs->line, err);
goto err_gpio_req;
}
spi_set_ctldata(spi, cs);
@@ -1116,7 +1116,8 @@ static int s3c64xx_spi_parse_dt_gpio(struct s3c64xx_spi_driver_data *sdd)
ret = gpio_request(gpio, "spi-bus");
if (ret) {
- dev_err(dev, "gpio [%d] request failed\n", gpio);
+ dev_err(dev, "gpio [%d] request failed: %d\n",
+ gpio, ret);
goto free_gpio;
}
}