iio: cleanup some new instances of manual parent setting.
Subsystems (6)
Jonathan Cameron
maintainercover iio: cleanup some new instances of manual parent setting.
From: Jonathan Cameron <[email protected]>
It seems I still haven't trained my eyes to spot these.
I think they have all been introduced sinceiio_device_alloc() and friends started setting this8525df47b3d1e ("iio: core: fix/re-introduce back parent assignment") 78289b4a58b58 ("iio: core: pass parent device as parameter during allocation")
Anyhow, all seem fairly obvious to me, but maybe I missed something so please take a look.
Jonathan Cameron (8):
iio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent
iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
iio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent
iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
iio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent
iio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent
iio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent
setting.
iio: common: scmi_sensors: Drop duplicate setting of
iio_dev.dev.parent
drivers/iio/accel/bmi088-accel-core.c | 1 - drivers/iio/adc/mp2629_adc.c | 1 - drivers/iio/adc/mt6360-adc.c | 1 - drivers/iio/adc/ti-ads131e08.c | 1 - drivers/iio/common/scmi_sensors/scmi_iio.c | 1 - drivers/iio/dac/ad5766.c | 1 - drivers/iio/humidity/hdc2010.c | 1 - drivers/iio/position/hid-sensor-custom-intel-hinge.c | 1 - 8 files changed, 8 deletions(-)
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 1/8 iio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent
From: Jonathan Cameron <[email protected]>
The core already set this to the same value in devm_iio_device_alloc()
--- drivers/iio/accel/bmi088-accel-core.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/accel/bmi088-accel-core.c +0 -1
@@ -496,7 +496,6 @@ int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap,if (ret)return ret; - indio_dev->dev.parent = dev; indio_dev->channels = data->chip_info->channels; indio_dev->num_channels = data->chip_info->num_channels; indio_dev->name = name ? name : data->chip_info->name;
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 2/8 iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
This is set to the same value in devm_iio_device_alloc() so no need to do it again.
--- drivers/iio/dac/ad5766.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/dac/ad5766.c +0 -1
@@ -597,7 +597,6 @@ static int ad5766_probe(struct spi_device *spi) indio_dev->channels = st->chip_info->channels; indio_dev->num_channels = st->chip_info->num_channels; indio_dev->info = &ad5766_info; - indio_dev->dev.parent = &spi->dev; indio_dev->dev.of_node = spi->dev.of_node; indio_dev->name =spi_get_device_id (spi)->name; indio_dev->modes =INDIO_DIRECT_MODE ;
Signature · 1 line
2.31.1
Re: [PATCH 2/8] iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
Quoted 17 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
This is set to the same value in
devm_iio_device_alloc()so no need to do it again.Signed-off-by Jonathan Cameron <[email protected]>Cc Cristian Pop <[email protected]>--- drivers/iio/dac/ad5766.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/dac/ad5766.c +0
-0
drivers/iio/dac/ad5766.c static int ad5766_probe(struct spi_device *spi) · line 600
Quoted 5 lines
drivers/iio/dac/ad5766.c +0
-1@@ -597,7 +597,6 @@ static int ad5766_probe(struct spi_device *spi) indio_dev->channels = st->chip_info->channels; indio_dev->num_channels = st->chip_info->num_channels; indio_dev->info = &ad5766_info; - indio_dev->dev.parent = &spi->dev; indio_dev->dev.of_node = spi->dev.of_node;
Unrelated to this series.
This looks like it could do without the of_node assignment as well.
I probably should have noticed this earlier.
Quoted 5 lines
drivers/iio/dac/ad5766.c +0
-1indio_dev->name =spi_get_device_id (spi)->name; indio_dev->modes =INDIO_DIRECT_MODE ; --2.31.1
Jonathan Cameron
maintainerRe: [PATCH 2/8] iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
Quoted 27 lines · On Tue, 27 Apr 2021 10:26:31 +0300 Alexandru Ardelean <[email protected]>…
Quoted 17 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
This is set to the same value in
devm_iio_device_alloc()so no need to do it again.Signed-off-by Jonathan Cameron <[email protected]>Cc Cristian Pop <[email protected]>--- drivers/iio/dac/ad5766.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/dac/ad5766.c +0
-0drivers/iio/dac/ad5766.c static int ad5766_probe(struct spi_device *spi) · line 600
Quoted 5 lines
drivers/iio/dac/ad5766.c +0
-1@@ -597,7 +597,6 @@ static int ad5766_probe(struct spi_device *spi) indio_dev->channels = st->chip_info->channels; indio_dev->num_channels = st->chip_info->num_channels; indio_dev->info = &ad5766_info; - indio_dev->dev.parent = &spi->dev; indio_dev->dev.of_node = spi->dev.of_node;Unrelated to this series.
This looks like it could do without theof_nodeassignment as well.
Quoted 1 line
I probably should have noticed this earlier.
Good point. Rather than having a separate patch I'll pull that in here whilst applying if no one shouts.
Thanks,
Jonathan
Quoted 6 lines
Quoted 6 lines
drivers/iio/dac/ad5766.c +0
-1indio_dev->name =spi_get_device_id (spi)->name; indio_dev->modes =INDIO_DIRECT_MODE ; --2.31.1
Jonathan Cameron
maintainerPATCH 3/8 iio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
This is already set to the same value in devm_iio_device_alloc()
--- drivers/iio/adc/mp2629_adc.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/mp2629_adc.c +0 -1
@@ -144,7 +144,6 @@ static int mp2629_adc_probe(struct platform_device *pdev) } indio_dev->name ="mp2629-adc" ; - indio_dev->dev.parent = dev; indio_dev->channels = mp2629_channels; indio_dev->num_channels =ARRAY_SIZE (mp2629_channels); indio_dev->modes =INDIO_DIRECT_MODE ;
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 4/8 iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Already set to the same value in devm_iio_device_alloc()
--- drivers/iio/adc/mt6360-adc.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/mt6360-adc.c +0 -1
@@ -337,7 +337,6 @@ static int mt6360_adc_probe(struct platform_device *pdev) } indio_dev->name =dev_name (&pdev->dev); - indio_dev->dev.parent = &pdev->dev; indio_dev->info = &mt6360_adc_iio_info; indio_dev->modes =INDIO_DIRECT_MODE ; indio_dev->channels = mt6360_adc_channels;
Signature · 1 line
2.31.1
Re: [PATCH 4/8] iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
Quoted 16 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Already set to the same value in
devm_iio_device_alloc()Signed-off-by Jonathan Cameron <[email protected]>Cc Gene Chen <[email protected]>--- drivers/iio/adc/mt6360-adc.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/adc/mt6360-adc.c +0
-0
drivers/iio/adc/mt6360-adc.c static int mt6360_adc_probe(struct platform_device *pdev) · line 339
Quoted 3 lines
drivers/iio/adc/mt6360-adc.c +0
-0@@ -337,7 +337,6 @@ static int mt6360_adc_probe(struct platform_device *pdev) } indio_dev->name =dev_name (&pdev->dev);
unrelated to this series, this dev_name(&pdev->dev) looks a bit weird; this should resolve to the driver name AFAICT; which is "mt6360-adc" it feels a bit off with respect to ABI; but maybe it's too late to change it?
Quoted 7 lines
drivers/iio/adc/mt6360-adc.c +0
-2- indio_dev->dev.parent = &pdev->dev; indio_dev->info = &mt6360_adc_iio_info; indio_dev->modes =INDIO_DIRECT_MODE ; indio_dev->channels = mt6360_adc_channels; --2.31.1
Re: [PATCH 4/8] iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
Quoted 19 lines · On Tue, 27 Apr 2021 10:25:05 +0300 Alexandru Ardelean <[email protected]>…
Quoted 18 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Already set to the same value in
devm_iio_device_alloc()Signed-off-by Jonathan Cameron <[email protected]>Cc Gene Chen <[email protected]>--- drivers/iio/adc/mt6360-adc.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/adc/mt6360-adc.c +0
-0@@ -337,7 +337,6 @@ static int mt6360_adc_probe(struct platform_device *pdev) }
Quoted 5 lines
drivers/iio/adc/mt6360-adc.c static int mt6360_adc_probe(struct platform_device *pdev) · line 339
Quoted 1 line
drivers/iio/adc/mt6360-adc.c +0
-0indio_dev->name =dev_name (&pdev->dev);unrelated to this series, this
dev_name(&pdev->dev)looks a bit weird; this should resolve to the driver name AFAICT; which is "mt6360-adc" it feels a bit off with respect to ABI; but maybe it's too late to change it?
Yup. We have some historical ones of these unfortunately when I wasn't paying attention properly. They are ABI for those parts now so we can't fix them without significant risk of breaking someones platform.
Jonathan
Quoted 8 lines
Quoted 8 lines
drivers/iio/adc/mt6360-adc.c +0
-2- indio_dev->dev.parent = &pdev->dev; indio_dev->info = &mt6360_adc_iio_info; indio_dev->modes =INDIO_DIRECT_MODE ; indio_dev->channels = mt6360_adc_channels; --2.31.1
Jonathan Cameron
maintainerPATCH 5/8 iio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Already set to same value in devm_iio_device_alloc()
--- drivers/iio/adc/ti-ads131e08.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ti-ads131e08.c +0 -1
@@ -824,7 +824,6 @@ static int ads131e08_probe(struct spi_device *spi)return ret; indio_dev->name = st->info->name; - indio_dev->dev.parent = &spi->dev; indio_dev->info = &ads131e08_iio_info; indio_dev->modes =INDIO_DIRECT_MODE ;
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 6/8 iio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Already set to same value in devm_iio_device_alloc()
--- drivers/iio/humidity/hdc2010.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/humidity/hdc2010.c +0 -1
@@ -272,7 +272,6 @@ static int hdc2010_probe(struct i2c_client *client, data->client = client;mutex_init (&data->lock); - indio_dev->dev.parent = &client->dev;/* * As DEVICE ID register does not differentiate between * HDC2010 and HDC2080, we have the name hardcoded
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 7/8 iio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent setting.
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
iio_dev.dev.parent is already set to the same value in devm_iio_device_alloc()
--- drivers/iio/position/hid-sensor-custom-intel-hinge.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/position/hid-sensor-custom-intel-hinge.c +0 -1
@@ -303,7 +303,6 @@ static int hid_hinge_probe(struct platform_device *pdev)return ret; } - indio_dev->dev.parent = &pdev->dev; indio_dev->info = &hinge_info; indio_dev->name ="hinge" ; indio_dev->modes =INDIO_DIRECT_MODE ;
Signature · 1 line
2.31.1
Jonathan Cameron
maintainerPATCH 8/8 iio: common: scmi_sensors: Drop duplicate setting of iio_dev.dev.parent
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
This is already set to the same value in devm_iio_device_alloc()
--- drivers/iio/common/scmi_sensors/scmi_iio.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/common/scmi_sensors/scmi_iio.c +0 -1
@@ -544,7 +544,6 @@ static struct iio_dev *scmi_alloc_iiodev(struct device *dev,return ERR_PTR (-ENOMEM ); iiodev->modes =INDIO_DIRECT_MODE ; - iiodev->dev.parent = dev; sensor =iio_priv (iiodev); sensor->handle = handle; sensor->sensor_info = sensor_info;
Signature · 1 line
2.31.1
Quoted 5 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
It seems I still haven't trained my eyes to spot these.
Quoted 7 lines
I think they have all been introduced since
iio_device_alloc()and friends started setting this8525df47b3d1e("iio: core: fix/re-introduce back parent assignment")78289b4a58b58("iio: core: pass parent device as parameter during allocation")Anyhow, all seem fairly obvious to me, but maybe I missed something so please take a look.
I've added 2 comments that are unrelated [directly] to this series.
Quoted 26 lines
Jonathan Cameron (8):
iio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent
iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
iio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent
iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
iio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent
iio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent
iio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent
setting.
iio: common:scmi_sensors: Drop duplicate setting of
iio_dev.dev.parentdrivers/iio/accel/bmi088-accel-core.c | 1 - drivers/iio/adc/mp2629_adc.c | 1 - drivers/iio/adc/mt6360-adc.c | 1 - drivers/iio/adc/ti-ads131e08.c | 1 - drivers/iio/common/scmi_sensors/scmi_iio.c | 1 - drivers/iio/dac/ad5766.c | 1 - drivers/iio/humidity/hdc2010.c | 1 - drivers/iio/position/hid-sensor-custom-intel-hinge.c | 1 - 8 files changed, 8 deletions(-)--
2.31.1
Jonathan Cameron
maintainerQuoted 11 lines · On Tue, 27 Apr 2021 10:27:44 +0300 Alexandru Ardelean <[email protected]>…
Quoted 10 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
It seems I still haven't trained my eyes to spot these.
I think they have all been introduced since
iio_device_alloc()and friends started setting this8525df47b3d1e("iio: core: fix/re-introduce back parent assignment")78289b4a58b58("iio: core: pass parent device as parameter during allocation")
Quoted 6 lines
Quoted 2 lines
Anyhow, all seem fairly obvious to me, but maybe I missed something so please take a look.
I've added 2 comments that are unrelated [directly] to this series.
Reviewed-by Alexandru Ardelean <[email protected]>
Thanks for checking these. I've added the of_node dropping bit to the patch you pointed that out in.
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to poke at it and see if we missed anything!
Thanks,
Jonathan
Quoted 27 lines
Quoted 27 lines
Jonathan Cameron (8):
iio: accel: bmi088: Drop manual assignment of iio_dev.dev.parent
iio: dac: ad5766: Drop duplicate setting of iio_dev.dev.parent
iio: adc: mp2629: Drop duplicate setting iio_dev.dev.parent
iio: adc: mt6360: Drop duplicate setting of iio_dev.dev.parent
iio: adc: ti-ads131e08: Drop duplicate setting of iio_dev.dev.parent
iio: humidity: hdc2010: Drop duplicate setting of iio_dev.dev.parent
iio: position: hid-sensor-custom-intel-hinge: Drop duplicate parent
setting.
iio: common:scmi_sensors: Drop duplicate setting of
iio_dev.dev.parentdrivers/iio/accel/bmi088-accel-core.c | 1 - drivers/iio/adc/mp2629_adc.c | 1 - drivers/iio/adc/mt6360-adc.c | 1 - drivers/iio/adc/ti-ads131e08.c | 1 - drivers/iio/common/scmi_sensors/scmi_iio.c | 1 - drivers/iio/dac/ad5766.c | 1 - drivers/iio/humidity/hdc2010.c | 1 - drivers/iio/position/hid-sensor-custom-intel-hinge.c | 1 - 8 files changed, 8 deletions(-)--
2.31.1