Skip to content

Commit

Permalink
gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()
Browse files Browse the repository at this point in the history
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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Jingoo Han authored and Linus Walleij committed Mar 27, 2013
1 parent 6c0cf42 commit 493294d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpio/gpio-mc33880.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int mc33880_probe(struct spi_device *spi)

mutex_init(&mc->lock);

dev_set_drvdata(&spi->dev, mc);
spi_set_drvdata(spi, mc);

mc->spi = spi;

Expand Down Expand Up @@ -142,7 +142,7 @@ static int mc33880_probe(struct spi_device *spi)
return ret;

exit_destroy:
dev_set_drvdata(&spi->dev, NULL);
spi_set_drvdata(spi, NULL);
mutex_destroy(&mc->lock);
return ret;
}
Expand All @@ -152,11 +152,11 @@ static int mc33880_remove(struct spi_device *spi)
struct mc33880 *mc;
int ret;

mc = dev_get_drvdata(&spi->dev);
mc = spi_get_drvdata(spi);
if (mc == NULL)
return -ENODEV;

dev_set_drvdata(&spi->dev, NULL);
spi_set_drvdata(spi, NULL);

ret = gpiochip_remove(&mc->chip);
if (!ret)
Expand Down

0 comments on commit 493294d

Please sign in to comment.