[PATCH 5/5] iio: remove left-over parent assignments

2020-05-22 Thread Alexandru Ardelean
These were found by doing some shell magic:

for file in $(git grep -w devm_iio_device_alloc | cut -d: -f1 | sort | uniq) ; 
do
if grep 'parent =' $file | grep -v trig | grep -vq devm_; then
echo "$file -> $(grep "parent =" $file)"
fi
done
---

The output is bearable [after the semantic patch is applied].
There is a mix of trigger assignments with some iio device parent
assignments that are removed via this patch.

Signed-off-by: Alexandru Ardelean 
---
 drivers/iio/accel/kxcjk-1013.c| 1 -
 drivers/iio/accel/mma8452.c   | 1 -
 drivers/iio/accel/mma9553.c   | 1 -
 drivers/iio/adc/ad7192.c  | 1 -
 drivers/iio/adc/hx711.c   | 1 -
 drivers/iio/adc/max1363.c | 2 --
 drivers/iio/adc/mcp3911.c | 1 -
 drivers/iio/adc/qcom-spmi-iadc.c  | 1 -
 drivers/iio/amplifiers/ad8366.c   | 1 -
 drivers/iio/chemical/vz89x.c  | 1 -
 drivers/iio/dac/ad5770r.c | 1 -
 drivers/iio/health/afe4403.c  | 1 -
 drivers/iio/health/afe4404.c  | 1 -
 drivers/iio/humidity/dht11.c  | 1 -
 drivers/iio/humidity/hts221_core.c| 1 -
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c| 1 -
 drivers/iio/light/cm3605.c| 1 -
 drivers/iio/light/ltr501.c| 1 -
 drivers/iio/magnetometer/ak8975.c | 1 -
 drivers/iio/orientation/hid-sensor-rotation.c | 1 -
 drivers/iio/potentiostat/lmp91000.c   | 1 -
 drivers/iio/proximity/ping.c  | 1 -
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 -
 drivers/iio/proximity/srf04.c | 1 -
 drivers/iio/proximity/srf08.c | 1 -
 drivers/iio/temperature/tsys01.c  | 1 -
 drivers/staging/iio/addac/adt7316.c   | 1 -
 27 files changed, 28 deletions(-)

diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index c9924a65c32a..6b93521c0e17 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -1311,7 +1311,6 @@ static int kxcjk1013_probe(struct i2c_client *client,
 
mutex_init(>mutex);
 
-   indio_dev->dev.parent = >dev;
indio_dev->channels = kxcjk1013_channels;
indio_dev->num_channels = ARRAY_SIZE(kxcjk1013_channels);
indio_dev->available_scan_masks = kxcjk1013_scan_masks;
diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 00e100fc845a..ef3df402fc3c 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1592,7 +1592,6 @@ static int mma8452_probe(struct i2c_client *client,
i2c_set_clientdata(client, indio_dev);
indio_dev->info = _info;
indio_dev->name = id->name;
-   indio_dev->dev.parent = >dev;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = data->chip_info->channels;
indio_dev->num_channels = data->chip_info->num_channels;
diff --git a/drivers/iio/accel/mma9553.c b/drivers/iio/accel/mma9553.c
index 312070dcf035..c15908faa381 100644
--- a/drivers/iio/accel/mma9553.c
+++ b/drivers/iio/accel/mma9553.c
@@ -1103,7 +1103,6 @@ static int mma9553_probe(struct i2c_client *client,
if (ret < 0)
return ret;
 
-   indio_dev->dev.parent = >dev;
indio_dev->channels = mma9553_channels;
indio_dev->num_channels = ARRAY_SIZE(mma9553_channels);
indio_dev->name = name;
diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c
index 08ba1a8f05eb..a0837d7e9176 100644
--- a/drivers/iio/adc/ad7192.c
+++ b/drivers/iio/adc/ad7192.c
@@ -970,7 +970,6 @@ static int ad7192_probe(struct spi_device *spi)
 
spi_set_drvdata(spi, indio_dev);
st->chip_info = of_device_get_match_data(>dev);
-   indio_dev->dev.parent = >dev;
indio_dev->name = st->chip_info->name;
indio_dev->modes = INDIO_DIRECT_MODE;
 
diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index c8686558429b..6a173531d355 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -551,7 +551,6 @@ static int hx711_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev);
 
indio_dev->name = "hx711";
-   indio_dev->dev.parent = >dev;
indio_dev->info = _iio_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = hx711_chan_spec;
diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index 9d92017c79b2..cc1ba7bfc8e6 100644
--- a/drivers/iio/adc/max1363.c
+++ b/drivers/iio/adc/max1363.c
@@ -1652,8 +1652,6 @@ static int max1363_probe(struct i2c_client *client,
if (ret)
goto error_disable_reg;
 
-   /* Establish that the iio_dev is a child of the i2c device */
- 

Re: [PATCH 5/5] iio: remove left-over parent assignments

2020-05-22 Thread Andy Shevchenko
On Fri, May 22, 2020 at 11:37 AM Alexandru Ardelean
 wrote:
>
> These were found by doing some shell magic:
> 
> for file in $(git grep -w devm_iio_device_alloc | cut -d: -f1 | sort | uniq) 
> ; do
> if grep 'parent =' $file | grep -v trig | grep -vq devm_; then
> echo "$file -> $(grep "parent =" $file)"
> fi
> done
> ---

Side note: time to learn coccinelle or shell better :-)

-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel