Commit 493294d4 authored by Jingoo Han's avatar Jingoo Han Committed by Linus Walleij

gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()

Use the wrapper functions for getting and setting the driver data
using spi_device instead of using dev_{get|set}_drvdata with
&spi->dev, so we can directly pass a struct spi_device.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6c0cf42b
...@@ -107,7 +107,7 @@ static int mc33880_probe(struct spi_device *spi) ...@@ -107,7 +107,7 @@ static int mc33880_probe(struct spi_device *spi)
mutex_init(&mc->lock); mutex_init(&mc->lock);
dev_set_drvdata(&spi->dev, mc); spi_set_drvdata(spi, mc);
mc->spi = spi; mc->spi = spi;
...@@ -142,7 +142,7 @@ static int mc33880_probe(struct spi_device *spi) ...@@ -142,7 +142,7 @@ static int mc33880_probe(struct spi_device *spi)
return ret; return ret;
exit_destroy: exit_destroy:
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
mutex_destroy(&mc->lock); mutex_destroy(&mc->lock);
return ret; return ret;
} }
...@@ -152,11 +152,11 @@ static int mc33880_remove(struct spi_device *spi) ...@@ -152,11 +152,11 @@ static int mc33880_remove(struct spi_device *spi)
struct mc33880 *mc; struct mc33880 *mc;
int ret; int ret;
mc = dev_get_drvdata(&spi->dev); mc = spi_get_drvdata(spi);
if (mc == NULL) if (mc == NULL)
return -ENODEV; return -ENODEV;
dev_set_drvdata(&spi->dev, NULL); spi_set_drvdata(spi, NULL);
ret = gpiochip_remove(&mc->chip); ret = gpiochip_remove(&mc->chip);
if (!ret) if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment