[PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()

Raag Jadav posted 12 patches 10 months, 1 week ago
drivers/iio/adc/xilinx-xadc-core.c          |   4 +-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c |   2 +-
drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c |   2 +-
drivers/input/keyboard/ipaq-micro-keys.c    |   5 +-
drivers/input/sparse-keymap.c               |   3 +-
drivers/pinctrl/intel/pinctrl-baytrail.c    |   6 +-
drivers/pinctrl/intel/pinctrl-cherryview.c  |   5 +-
drivers/pinctrl/intel/pinctrl-intel.c       |   6 +-
drivers/pinctrl/intel/pinctrl-tangier.c     |   5 +-
drivers/pinctrl/pxa/pinctrl-pxa2xx.c        |   8 +-
include/linux/device.h                      | 119 +-----------------
include/linux/device/devres.h               | 129 ++++++++++++++++++++
include/linux/err.h                         |   3 +
include/linux/io.h                          |   2 -
14 files changed, 152 insertions(+), 147 deletions(-)
create mode 100644 include/linux/device/devres.h
[PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
Posted by Raag Jadav 10 months, 1 week ago
This series

1. Splits device/devres.h for the users that are only interested in devres APIs.
   Original work by Andy Shevchenko:
   https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com

2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
   across drivers.

The idea behind embedding both work into a single series is to make the review
process easier and reduce conflicts while merging.

Current proposal is to merge initial patches with an immutable tag (volunteered
by Andy) for other subsystems to use. Feel free to share a better alternative.

v2: Use size_mul() for multiplication (Dmitry)
    Update commit message (Dmitry)

v3: Embed devres.h work by Andy
    Add more users of devm_kmemdup_array()
    Update tags and rebase

v4: Use IOMEM_ERR_PTR() to fix sparse warnings (Andy)
    Use source size and make it robust against type changes (Andy)

v5: Move IOMEM_ERR_PTR() to err.h (Andy)
    Reduce distribution to pinctrl/iio/input patches

Andy Shevchenko (2):
  driver core: Split devres APIs to device/devres.h
  iio: imu: st_lsm9ds0: Replace device.h with what is needed

Raag Jadav (10):
  err.h: move IOMEM_ERR_PTR() to err.h
  devres: Introduce devm_kmemdup_array()
  pinctrl: intel: copy communities using devm_kmemdup_array()
  pinctrl: baytrail: copy communities using devm_kmemdup_array()
  pinctrl: cherryview: use devm_kmemdup_array()
  pinctrl: tangier: use devm_kmemdup_array()
  pinctrl: pxa2xx: use devm_kmemdup_array()
  iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
  input: sparse-keymap: use devm_kmemdup_array()
  input: ipaq-micro-keys: use devm_kmemdup_array()

 drivers/iio/adc/xilinx-xadc-core.c          |   4 +-
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c |   2 +-
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c |   2 +-
 drivers/input/keyboard/ipaq-micro-keys.c    |   5 +-
 drivers/input/sparse-keymap.c               |   3 +-
 drivers/pinctrl/intel/pinctrl-baytrail.c    |   6 +-
 drivers/pinctrl/intel/pinctrl-cherryview.c  |   5 +-
 drivers/pinctrl/intel/pinctrl-intel.c       |   6 +-
 drivers/pinctrl/intel/pinctrl-tangier.c     |   5 +-
 drivers/pinctrl/pxa/pinctrl-pxa2xx.c        |   8 +-
 include/linux/device.h                      | 119 +-----------------
 include/linux/device/devres.h               | 129 ++++++++++++++++++++
 include/linux/err.h                         |   3 +
 include/linux/io.h                          |   2 -
 14 files changed, 152 insertions(+), 147 deletions(-)
 create mode 100644 include/linux/device/devres.h


base-commit: 0eee258cdf172763502f142d85e967f27a573be0
-- 
2.34.1
Re: [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
Posted by Andy Shevchenko 10 months, 1 week ago
On Wed, Feb 12, 2025 at 11:55:01AM +0530, Raag Jadav wrote:
> This series
> 
> 1. Splits device/devres.h for the users that are only interested in devres APIs.
>    Original work by Andy Shevchenko:
>    https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com
> 
> 2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
>    across drivers.
> 
> The idea behind embedding both work into a single series is to make the review
> process easier and reduce conflicts while merging.
> 
> Current proposal is to merge initial patches with an immutable tag (volunteered
> by Andy) for other subsystems to use. Feel free to share a better alternative.

> v5: Move IOMEM_ERR_PTR() to err.h (Andy)
>     Reduce distribution to pinctrl/iio/input patches

Weren't there two more patches that were actually Acked by Jonathan?

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
Posted by Raag Jadav 10 months, 1 week ago
On Wed, Feb 12, 2025 at 01:05:17PM +0200, Andy Shevchenko wrote:
> On Wed, Feb 12, 2025 at 11:55:01AM +0530, Raag Jadav wrote:
> > This series
> > 
> > 1. Splits device/devres.h for the users that are only interested in devres APIs.
> >    Original work by Andy Shevchenko:
> >    https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com
> > 
> > 2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
> >    across drivers.
> > 
> > The idea behind embedding both work into a single series is to make the review
> > process easier and reduce conflicts while merging.
> > 
> > Current proposal is to merge initial patches with an immutable tag (volunteered
> > by Andy) for other subsystems to use. Feel free to share a better alternative.
> 
> > v5: Move IOMEM_ERR_PTR() to err.h (Andy)
> >     Reduce distribution to pinctrl/iio/input patches
> 
> Weren't there two more patches that were actually Acked by Jonathan?

Nope, iio only has one user each.

Raag
Re: [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
Posted by Andy Shevchenko 10 months, 1 week ago
On Wed, Feb 12, 2025 at 06:22:06PM +0200, Raag Jadav wrote:
> On Wed, Feb 12, 2025 at 01:05:17PM +0200, Andy Shevchenko wrote:
> > On Wed, Feb 12, 2025 at 11:55:01AM +0530, Raag Jadav wrote:
> > > This series
> > > 
> > > 1. Splits device/devres.h for the users that are only interested in devres APIs.
> > >    Original work by Andy Shevchenko:
> > >    https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com
> > > 
> > > 2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
> > >    across drivers.
> > > 
> > > The idea behind embedding both work into a single series is to make the review
> > > process easier and reduce conflicts while merging.
> > > 
> > > Current proposal is to merge initial patches with an immutable tag (volunteered
> > > by Andy) for other subsystems to use. Feel free to share a better alternative.
> > 
> > > v5: Move IOMEM_ERR_PTR() to err.h (Andy)
> > >     Reduce distribution to pinctrl/iio/input patches
> > 
> > Weren't there two more patches that were actually Acked by Jonathan?
> 
> Nope, iio only has one user each.

Okay, so we basically waiting then for Greg KH to review / ack the couple of
patches (2 and 4) and Dmitry and Jonathan one patch for each.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v5 00/12] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
Posted by Andy Shevchenko 10 months ago
On Wed, Feb 12, 2025 at 07:21:34PM +0200, Andy Shevchenko wrote:
> On Wed, Feb 12, 2025 at 06:22:06PM +0200, Raag Jadav wrote:
> > On Wed, Feb 12, 2025 at 01:05:17PM +0200, Andy Shevchenko wrote:
> > > On Wed, Feb 12, 2025 at 11:55:01AM +0530, Raag Jadav wrote:
> > > > This series
> > > > 
> > > > 1. Splits device/devres.h for the users that are only interested in devres APIs.
> > > >    Original work by Andy Shevchenko:
> > > >    https://lore.kernel.org/r/20241203195340.855879-1-andriy.shevchenko@linux.intel.com
> > > > 
> > > > 2. Introduces a more robust and cleaner devm_kmemdup_array() helper and uses it
> > > >    across drivers.
> > > > 
> > > > The idea behind embedding both work into a single series is to make the review
> > > > process easier and reduce conflicts while merging.
> > > > 
> > > > Current proposal is to merge initial patches with an immutable tag (volunteered
> > > > by Andy) for other subsystems to use. Feel free to share a better alternative.
> > > 
> > > > v5: Move IOMEM_ERR_PTR() to err.h (Andy)
> > > >     Reduce distribution to pinctrl/iio/input patches
> > > 
> > > Weren't there two more patches that were actually Acked by Jonathan?
> > 
> > Nope, iio only has one user each.
> 
> Okay, so we basically waiting then for Greg KH to review / ack the couple of
> patches (2 and 4) and Dmitry and Jonathan one patch for each.

I'm going to apply this series to Intel pin control tree soon and share
an immutable tag TWIMC, please tell me if it shouldn't be the case.

-- 
With Best Regards,
Andy Shevchenko