gpio: 74x164: use spi_get_drvdata() and spi_set_drvdata()
PATCH 1/2 gpio: 74x164: 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.
--- drivers/gpio/gpio-74x164.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpio/gpio-74x164.c +4 -4
@@ -137,7 +137,7 @@ static int gen_74x164_probe(struct spi_device *spi)mutex_init (&chip->lock); -dev_set_drvdata (&spi->dev, chip); +spi_set_drvdata (spi, chip); chip->spi = spi;
@@ -176,7 +176,7 @@ static int gen_74x164_probe(struct spi_device *spi)return ret; exit_destroy: -dev_set_drvdata (&spi->dev,NULL ); +spi_set_drvdata (spi,NULL );mutex_destroy (&chip->lock);return ret; }
@@ -186,11 +186,11 @@ static int gen_74x164_remove(struct spi_device *spi)struct gen_74x164_chip *chip;int ret; - chip =dev_get_drvdata (&spi->dev); + chip =spi_get_drvdata (spi);if (chip ==NULL )return -ENODEV ; -dev_set_drvdata (&spi->dev,NULL ); +spi_set_drvdata (spi,NULL ); ret =gpiochip_remove (&chip->gpio_chip);if (!ret)
Signature · 1 line
1.7.2.5
PATCH 2/2 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.
--- drivers/gpio/gpio-mc33880.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpio/gpio-mc33880.c +4 -4
@@ -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;
@@ -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; }
@@ -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)
Signature · 1 line
1.7.2.5
Re: [PATCH 2/2] gpio: mc33880: use spi_get_drvdata() and spi_set_drvdata()
Quoted 5 lines · Jingoo Han
Use the wrapper functions for getting and setting the driver data using
spi_deviceinstead of using dev_{get|set}_drvdata with&spi->dev, so we can directly pass a structspi_device.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij
Quoted 5 lines · Jingoo Han
Use the wrapper functions for getting and setting the driver data using
spi_deviceinstead of using dev_{get|set}_drvdata with&spi->dev, so we can directly pass a structspi_device.Signed-off-by Jingoo Han <[email protected]>
Patch applied.
Thanks!
Linus Walleij