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. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
30db2bd1c8
commit
6c0cf42be3
@ -137,7 +137,7 @@ static int gen_74x164_probe(struct spi_device *spi)
|
|||||||
|
|
||||||
mutex_init(&chip->lock);
|
mutex_init(&chip->lock);
|
||||||
|
|
||||||
dev_set_drvdata(&spi->dev, chip);
|
spi_set_drvdata(spi, chip);
|
||||||
|
|
||||||
chip->spi = spi;
|
chip->spi = spi;
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ static int gen_74x164_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(&chip->lock);
|
mutex_destroy(&chip->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -186,11 +186,11 @@ static int gen_74x164_remove(struct spi_device *spi)
|
|||||||
struct gen_74x164_chip *chip;
|
struct gen_74x164_chip *chip;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
chip = dev_get_drvdata(&spi->dev);
|
chip = spi_get_drvdata(spi);
|
||||||
if (chip == NULL)
|
if (chip == NULL)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
dev_set_drvdata(&spi->dev, NULL);
|
spi_set_drvdata(spi, NULL);
|
||||||
|
|
||||||
ret = gpiochip_remove(&chip->gpio_chip);
|
ret = gpiochip_remove(&chip->gpio_chip);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
Reference in New Issue
Block a user