[PATCH v2 0/5] iio: adc: bcm_iproc_adc: use device-managed resources

mdshahid03@gmail.com posted 5 patches 3 weeks, 6 days ago
drivers/iio/adc/bcm_iproc_adc.c | 62 ++++++++++++++-------------------
1 file changed, 26 insertions(+), 36 deletions(-)
[PATCH v2 0/5] iio: adc: bcm_iproc_adc: use device-managed resources
Posted by mdshahid03@gmail.com 3 weeks, 6 days ago
From: Mohammad Shahid <mdshahid03@gmail.com>

Changes since v1:

- Sort headers and make the driver IWYU compliant.
- Use devm_clk_get_enabled() and devm_add_action_or_reset() for
- clock and ADC cleanup.
- Use devm_mutex_init() and devm_iio_device_register(), removing
  the manual cleanup paths and remove() callback.

I checked the history of IPROC_ADC_AUXIN_SCAN_ENA and the related
iProc touchscreen driver. There is no documented dependency requiring
the bit to be cleared before tsc_clk is enabled.

I also checked the touchscreen driver's shared-register handling. It
enables tsc_clk before configuring the shared REGCTL2, and its
history does not indicate an ordering requirement involving
IPROC_ADC_AUXIN_SCAN_ENA.

Therefore, devm_clk_get_enabled() is used as suggested.

linux/delay.h is retained because the driver directly uses udelay().

---
Mohammad Shahid (5):
  iio: adc: bcm_iproc_adc: sort headers alphabetically
  iio: adc: bcm_iproc_adc: fix include dependencies
  iio: adc: bcm_iproc_adc: use devm-managed cleanup
  iio: adc: bcm_iproc_adc: use devm-managed mutex initialization
  iio: adc: bcm_iproc_adc: use devm_iio_device_register()

 drivers/iio/adc/bcm_iproc_adc.c | 62 ++++++++++++++-------------------
 1 file changed, 26 insertions(+), 36 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/5] iio: adc: bcm_iproc_adc: use device-managed resources
Posted by mdshahid03@gmail.com 3 weeks, 4 days ago
Hi all,

Thanks for the reviews and suggestions.

For v3, I will incorporate the following changes:

Patch 2/5:
-Add the direct includes for <linux/bits.h>, <linux/types.h>, and <linux/array_size.h>.
 Keep <linux/device-id/of.h> and <linux/iio/types.h> out, as these are already provided through the appropriate headers.
Patch 5/5:
-Remove the now-unnecessary platform_set_drvdata().
-Return devm_iio_device_register() directly.
-Remove the unnecessary backticks around function names in the commit message.

For patch 3/5, I understand that splitting the ADC cleanup into a follow-up patch would be preferable from a patch-scope 
perspective.I will split this into a separate patch for v3.

Please let me know if I have misunderstood any of the review comments.

Thanks,

Shahid
Re: [PATCH v2 0/5] iio: adc: bcm_iproc_adc: use device-managed resources
Posted by Marcelo Schmitt 3 weeks ago
Hello Shahid,

On 09/01, mdshahid03@gmail.com wrote:
> Hi all,
> 
> Thanks for the reviews and suggestions.
> 
> For v3, I will incorporate the following changes:
> 
> Patch 2/5:
> -Add the direct includes for <linux/bits.h>, <linux/types.h>, and <linux/array_size.h>.
>  Keep <linux/device-id/of.h> and <linux/iio/types.h> out, as these are already provided through the appropriate headers.
> Patch 5/5:
> -Remove the now-unnecessary platform_set_drvdata().
> -Return devm_iio_device_register() directly.
> -Remove the unnecessary backticks around function names in the commit message.
> 
> For patch 3/5, I understand that splitting the ADC cleanup into a follow-up patch would be preferable from a patch-scope 
> perspective.I will split this into a separate patch for v3.
> 
> Please let me know if I have misunderstood any of the review comments.

I believe the above list is correct.

With best regards,
Marcelo