diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2020-05-22 11:22:05 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-06-14 11:49:59 +0100 |
commit | d3be83244c7dfe686d23f1c0bac75915587fc044 (patch) | |
tree | 4f3a62d66fb2bb21a430c2238c4301a1a23557d9 /drivers/staging/iio | |
parent | f5d017938e7a6517b85f7fd215213a28e11291fb (diff) | |
download | linux-d3be83244c7dfe686d23f1c0bac75915587fc044.tar.bz2 |
iio: remove explicit IIO device parent assignment
This patch applies the semantic patch:
@@
expression I, P, SP;
@@
I = devm_iio_device_alloc(P, SP);
...
- I->dev.parent = P;
It updates 302 files and does 307 deletions.
This semantic patch also removes some comments like
'/* Establish that the iio_dev is a child of the i2c device */'
But this is is only done in case where the block is left empty.
The patch does not seem to cover all cases. It looks like in some cases a
different variable is used in some cases to assign the parent, but it
points to the same reference.
In other cases, the block covered by ... may be just too big to be covered
by the semantic patch.
However, this looks pretty good as well, as it does cover a big bulk of the
drivers that should remove the parent assignment.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/accel/adis16203.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/accel/adis16240.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7280a.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/adc/ad7816.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/cdc/ad7150.c | 2 | ||||
-rw-r--r-- | drivers/staging/iio/cdc/ad7746.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/frequency/ad9832.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/frequency/ad9834.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/impedance-analyzer/ad5933.c | 1 | ||||
-rw-r--r-- | drivers/staging/iio/resolver/ad2s1210.c | 1 |
10 files changed, 0 insertions, 11 deletions
diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c index fef52d9b5346..c7798908ef0e 100644 --- a/drivers/staging/iio/accel/adis16203.c +++ b/drivers/staging/iio/accel/adis16203.c @@ -277,7 +277,6 @@ static int adis16203_probe(struct spi_device *spi) spi_set_drvdata(spi, indio_dev); indio_dev->name = spi->dev.driver->name; - indio_dev->dev.parent = &spi->dev; indio_dev->channels = adis16203_channels; indio_dev->num_channels = ARRAY_SIZE(adis16203_channels); indio_dev->info = &adis16203_info; diff --git a/drivers/staging/iio/accel/adis16240.c b/drivers/staging/iio/accel/adis16240.c index 8bd35c6c56a1..38ec40b458c9 100644 --- a/drivers/staging/iio/accel/adis16240.c +++ b/drivers/staging/iio/accel/adis16240.c @@ -400,7 +400,6 @@ static int adis16240_probe(struct spi_device *spi) spi_set_drvdata(spi, indio_dev); indio_dev->name = spi->dev.driver->name; - indio_dev->dev.parent = &spi->dev; indio_dev->info = &adis16240_info; indio_dev->channels = adis16240_channels; indio_dev->num_channels = ARRAY_SIZE(adis16240_channels); diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index bef6bd1295ea..fef0055b8990 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -978,7 +978,6 @@ static int ad7280_probe(struct spi_device *spi) st->readback_delay_us += 5; /* Add tWAIT */ indio_dev->name = spi_get_device_id(spi)->name; - indio_dev->dev.parent = &spi->dev; indio_dev->modes = INDIO_DIRECT_MODE; ret = ad7280_channel_init(st); diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index a9985a7f8199..6c14d7bcdd67 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -394,7 +394,6 @@ static int ad7816_probe(struct spi_device *spi_dev) } indio_dev->name = spi_get_device_id(spi_dev)->name; - indio_dev->dev.parent = &spi_dev->dev; indio_dev->info = &ad7816_info; indio_dev->modes = INDIO_DIRECT_MODE; diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index f4954d85553e..48132ab157ef 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -590,8 +590,6 @@ static int ad7150_probe(struct i2c_client *client, indio_dev->name = id->name; indio_dev->channels = ad7150_channels; indio_dev->num_channels = ARRAY_SIZE(ad7150_channels); - /* Establish that the iio_dev is a child of the i2c device */ - indio_dev->dev.parent = &client->dev; indio_dev->info = &ad7150_info; diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c index 21527d84f940..bd9803c7c5b6 100644 --- a/drivers/staging/iio/cdc/ad7746.c +++ b/drivers/staging/iio/cdc/ad7746.c @@ -695,7 +695,6 @@ static int ad7746_probe(struct i2c_client *client, /* Establish that the iio_dev is a child of the i2c device */ indio_dev->name = id->name; - indio_dev->dev.parent = &client->dev; indio_dev->info = &ad7746_info; indio_dev->channels = ad7746_channels; if (id->driver_data == 7746) diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c index 74308a2e72db..447937e04ebd 100644 --- a/drivers/staging/iio/frequency/ad9832.c +++ b/drivers/staging/iio/frequency/ad9832.c @@ -348,7 +348,6 @@ static int ad9832_probe(struct spi_device *spi) st->spi = spi; mutex_init(&st->lock); - indio_dev->dev.parent = &spi->dev; indio_dev->name = spi_get_device_id(spi)->name; indio_dev->info = &ad9832_info; indio_dev->modes = INDIO_DIRECT_MODE; diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 23026978a5a5..77f77a2b2e05 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -431,7 +431,6 @@ static int ad9834_probe(struct spi_device *spi) st->spi = spi; st->devid = spi_get_device_id(spi)->driver_data; st->reg = reg; - indio_dev->dev.parent = &spi->dev; indio_dev->name = spi_get_device_id(spi)->name; switch (st->devid) { case ID_AD9833: diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index c468355b0848..dba78896ea8f 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -759,7 +759,6 @@ static int ad5933_probe(struct i2c_client *client, INIT_DELAYED_WORK(&st->work, ad5933_work); st->poll_time_jiffies = msecs_to_jiffies(AD5933_POLL_TIME_ms); - indio_dev->dev.parent = &client->dev; indio_dev->info = &ad5933_info; indio_dev->name = id->name; indio_dev->modes = (INDIO_BUFFER_SOFTWARE | INDIO_DIRECT_MODE); diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c index ed404355ea4c..74adb82f37c3 100644 --- a/drivers/staging/iio/resolver/ad2s1210.c +++ b/drivers/staging/iio/resolver/ad2s1210.c @@ -671,7 +671,6 @@ static int ad2s1210_probe(struct spi_device *spi) st->resolution = 12; st->fexcit = AD2S1210_DEF_EXCIT; - indio_dev->dev.parent = &spi->dev; indio_dev->info = &ad2s1210_info; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = ad2s1210_channels; |