mbox series

[v3,00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()

Message ID 20250203080902.1864382-1-raag.jadav@intel.com (mailing list archive)
Headers show
Series Split devres APIs to device/devres.h and introduce devm_kmemdup_array() | expand

Message

Raag Jadav Feb. 3, 2025, 8:08 a.m. UTC
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 reduce conflicts
and dependencies while merging.

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

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 (18):
  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()
  input: sparse-keymap: use devm_kmemdup_array()
  input: ipaq-micro-keys: use devm_kmemdup_array()
  regulator: devres: use devm_kmemdup_array()
  regulator: cros-ec: use devm_kmemdup_array()
  power: supply: sc27xx: use devm_kmemdup_array()
  iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
  ASoC: Intel: avs: use devm_kmemdup_array()
  ASoC: hdac_hdmi: use devm_kmemdup_array()
  ASoC: tlv320dac33: use devm_kmemdup_array()
  ASoC: uda1380: use devm_kmemdup_array()
  ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
  ASoC: uniphier: 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 +-
 drivers/power/supply/sc27xx_fuel_gauge.c    |   5 +-
 drivers/regulator/cros-ec-regulator.c       |   4 +-
 drivers/regulator/devres.c                  |   5 +-
 include/linux/device.h                      | 119 +-----------------
 include/linux/device/devres.h               | 129 ++++++++++++++++++++
 sound/soc/codecs/hdac_hdmi.c                |   3 +-
 sound/soc/codecs/tlv320dac33.c              |   6 +-
 sound/soc/codecs/uda1380.c                  |   6 +-
 sound/soc/intel/avs/boards/da7219.c         |   3 +-
 sound/soc/intel/avs/boards/es8336.c         |   3 +-
 sound/soc/intel/avs/boards/nau8825.c        |   3 +-
 sound/soc/intel/avs/boards/rt274.c          |   3 +-
 sound/soc/intel/avs/boards/rt286.c          |   3 +-
 sound/soc/intel/avs/boards/rt298.c          |   3 +-
 sound/soc/intel/avs/boards/rt5663.c         |   3 +-
 sound/soc/intel/avs/boards/rt5682.c         |   2 +-
 sound/soc/meson/axg-tdm-interface.c         |   9 +-
 sound/soc/uniphier/aio-cpu.c                |   8 +-
 28 files changed, 179 insertions(+), 184 deletions(-)
 create mode 100644 include/linux/device/devres.h


base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b

Comments

Andy Shevchenko Feb. 3, 2025, 9:48 a.m. UTC | #1
On Mon, Feb 03, 2025 at 01:38:42PM +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 reduce conflicts
> and dependencies while merging.
> 
> 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()

I understand the desire to cover as much as possible, but it becomes much
harder to coordinate. My proposal stays the same, i.e. I may take the GPIO/pin
control related (and already ACKed!) changes via Intel pin control tree and
the rest may use that immutable tag as needed.

What we need is an Ack for the first patch from Greg and perhaps I can take
IIO, if Jonathan gives an Ack.

>     Update tags and rebase
Raag Jadav Feb. 3, 2025, 10:34 a.m. UTC | #2
On Mon, Feb 03, 2025 at 11:48:52AM +0200, Andy Shevchenko wrote:
> On Mon, Feb 03, 2025 at 01:38:42PM +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 reduce conflicts
> > and dependencies while merging.
> > 
> > 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()
> 
> I understand the desire to cover as much as possible, but it becomes much
> harder to coordinate.

I have a few more patches which I'm delaying to reduce dependency.

Raag
Andy Shevchenko Feb. 3, 2025, 11:29 a.m. UTC | #3
On Mon, Feb 03, 2025 at 12:34:03PM +0200, Raag Jadav wrote:
> On Mon, Feb 03, 2025 at 11:48:52AM +0200, Andy Shevchenko wrote:
> > On Mon, Feb 03, 2025 at 01:38:42PM +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 reduce conflicts
> > > and dependencies while merging.
> > > 
> > > 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()
> > 
> > I understand the desire to cover as much as possible, but it becomes much
> > harder to coordinate.
> 
> I have a few more patches which I'm delaying to reduce dependency.

So, let's focus on the IIO/pin control ones only for the starter? With the
produced immutable tag you may convince the respective maintainers to pull
that tag along with the patches to their subsystems. It will be much easier
to coordinate and execute.