diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-03-03 23:59:53 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-10 07:23:37 -0400 |
commit | fcba212de9bdf1016d981c355df29ab169da8eae (patch) | |
tree | ab61ad628cebe33564c86624d12c726d4843e8bd | |
parent | bf5c2e27036cffda6e20f445391a4d4e1ccc232e (diff) |
spi: clps711x: Provide label argument for devm_gpio_request
The label argument was removed by commit 989847967cd762
spi: clps711x: Use devm_gpio_request(), add it back.
This makes it easier to know the gpio usage in /sys/kernel/debug/gpio.
Also remove unnecessary gpio_is_valid() checking, devm_gpio_request() returns
error if the requested gpio is invalid.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-clps711x.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c index eda7472ceefa..a5938abacfb0 100644 --- a/drivers/spi/spi-clps711x.c +++ b/drivers/spi/spi-clps711x.c | |||
@@ -159,14 +159,10 @@ static int spi_clps711x_probe(struct platform_device *pdev) | |||
159 | 159 | ||
160 | for (i = 0; i < master->num_chipselect; i++) { | 160 | for (i = 0; i < master->num_chipselect; i++) { |
161 | master->cs_gpios[i] = pdata->chipselect[i]; | 161 | master->cs_gpios[i] = pdata->chipselect[i]; |
162 | if (!gpio_is_valid(master->cs_gpios[i])) { | 162 | ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i], |
163 | dev_err(&pdev->dev, "Invalid CS GPIO %i\n", i); | 163 | DRIVER_NAME); |
164 | ret = -EINVAL; | 164 | if (ret) { |
165 | goto err_out; | ||
166 | } | ||
167 | if (devm_gpio_request(&pdev->dev, master->cs_gpios[i], NULL)) { | ||
168 | dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i); | 165 | dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i); |
169 | ret = -EINVAL; | ||
170 | goto err_out; | 166 | goto err_out; |
171 | } | 167 | } |
172 | } | 168 | } |