diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-07-19 01:36:13 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-07-19 01:36:13 -0400 |
commit | 49f3eacfcdab2e1cd381dc8e820bb6840787be00 (patch) | |
tree | c54f314c09e604ec091c383926c8b0f3de97e34a /drivers/spi/spi-s3c64xx.c | |
parent | f9ed561ebd71f7a9a3238507ef9082862e2cbc9a (diff) |
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/spi-s3c64xx.c')
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 9 |
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) | |||
896 | if (!spi_get_ctldata(spi)) { | 896 | if (!spi_get_ctldata(spi)) { |
897 | err = gpio_request(cs->line, dev_name(&spi->dev)); | 897 | err = gpio_request(cs->line, dev_name(&spi->dev)); |
898 | if (err) { | 898 | if (err) { |
899 | dev_err(&spi->dev, "request for slave select gpio " | 899 | dev_err(&spi->dev, |
900 | "line [%d] failed\n", cs->line); | 900 | "Failed to get /CS gpio [%d]: %d\n", |
901 | err = -EBUSY; | 901 | cs->line, err); |
902 | goto err_gpio_req; | 902 | goto err_gpio_req; |
903 | } | 903 | } |
904 | spi_set_ctldata(spi, cs); | 904 | spi_set_ctldata(spi, cs); |
@@ -1116,7 +1116,8 @@ static int s3c64xx_spi_parse_dt_gpio(struct s3c64xx_spi_driver_data *sdd) | |||
1116 | 1116 | ||
1117 | ret = gpio_request(gpio, "spi-bus"); | 1117 | ret = gpio_request(gpio, "spi-bus"); |
1118 | if (ret) { | 1118 | if (ret) { |
1119 | dev_err(dev, "gpio [%d] request failed\n", gpio); | 1119 | dev_err(dev, "gpio [%d] request failed: %d\n", |
1120 | gpio, ret); | ||
1120 | goto free_gpio; | 1121 | goto free_gpio; |
1121 | } | 1122 | } |
1122 | } | 1123 | } |