iio: adc: ad7292: remove unneeded spi_set_drvdata()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Thu, 19 Nov 2020 14:27:20 +0000 (16:27 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Nov 2020 15:15:28 +0000 (15:15 +0000)
This seems to have been copied from a driver that calls spi_set_drvdata()
but doesn't call spi_get_drvdata().
Setting a private object on the SPI device's object isn't necessary if it
won't be accessed.
This change removes the spi_set_drvdata() call.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Tested-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20201119142720.86326-1-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7292.c

index ab204e9199e99e3678ee5fcca47512bc84487219..70e33dd1c9f7247c27dea7c75f11d66fe8510223 100644 (file)
@@ -276,8 +276,6 @@ static int ad7292_probe(struct spi_device *spi)
                return -EINVAL;
        }
 
-       spi_set_drvdata(spi, indio_dev);
-
        st->reg = devm_regulator_get_optional(&spi->dev, "vref");
        if (!IS_ERR(st->reg)) {
                ret = regulator_enable(st->reg);