[PATCH v4 3/4] EISA: Convert to use pci_bus_for_each_resource_p()

2023-03-10 Thread Andy Shevchenko
The pci_bus_for_each_resource_p() hides the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- drivers/eisa/pci_eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v4 2/4] PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource()

2023-03-10 Thread Andy Shevchenko
Refactor pci_bus_for_each_resource() in the same way as it's done in pci_dev_for_each_resource() case. This will allow to hide iterator inside the loop, where it's not used otherwise. No functional changes intended. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang

[PATCH v4 0/4] PCI: Add pci_dev_for_each_resource() helper and update users

2023-03-10 Thread Andy Shevchenko
above - added tag to pcmcia patch (Dominik) Changelog v2: - refactor to have two macros - refactor existing pci_bus_for_each_resource() in the same way and convert users Andy Shevchenko (3): PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource() EISA: Convert to use

Re: [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-14 Thread Andy Shevchenko
> > 059b4a086017fb Mika Westerberg 2023-03-10 249 > resource_size(r) == 0) > 0509ad5e1a7d92 Bjorn Helgaas 2008-03-11 250 > continue; Thanks, I'll fix in v5. -- With Best Regards, Andy Shevchenko

[PATCH v5 0/4] PCI: Add pci_dev_for_each_resource() helper and update users

2023-03-14 Thread Andy Shevchenko
and convert users Andy Shevchenko (3): PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource() EISA: Convert to use pci_bus_for_each_resource_p() pcmcia: Convert to use pci_bus_for_each_resource_p() Mika Westerberg (1): PCI: Introduce pci_dev_for_each_resource() .clang

Re: [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-14 Thread Andy Shevchenko
On Fri, Mar 10, 2023 at 03:15:38PM -0700, Keith Busch wrote: > On Fri, Mar 10, 2023 at 07:14:13PM +0200, Andy Shevchenko wrote: ... > > +#define pci_dev_for_each_resource_p(dev, res) > > \ > > + __pci_dev_for_each_resource(dev, res, i, unsign

[PATCH v5 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-14 Thread Andy Shevchenko
. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang-format | 2 ++ arch/alpha/kernel/pci.c | 5 ++-- arch/arm/kernel/bios32.c | 16

[PATCH v5 4/4] pcmcia: Convert to use pci_bus_for_each_resource_p()

2023-03-14 Thread Andy Shevchenko
The pci_bus_for_each_resource_p() hides the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Acked-by: Dominik Brodowski --- drivers/pcmcia/rsrc_nonstatic.c | 9

[PATCH v5 2/4] PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource()

2023-03-14 Thread Andy Shevchenko
Refactor pci_bus_for_each_resource() in the same way as it's done in pci_dev_for_each_resource() case. This will allow to hide iterator inside the loop, where it's not used otherwise. No functional changes intended. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang

[PATCH v5 3/4] EISA: Convert to use pci_bus_for_each_resource_p()

2023-03-14 Thread Andy Shevchenko
The pci_bus_for_each_resource_p() hides the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- drivers/eisa/pci_eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH v6 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-23 Thread Andy Shevchenko
On Thu, Mar 23, 2023 at 10:02:38AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 23, 2023 at 04:30:01PM +0200, Andy Shevchenko wrote: ... > I poked around looking for similar patterns elsewhere with: > > git grep "#define.*for_each_.*_p(" > git grep "#define.*f

Re: [PATCH v6 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-23 Thread Andy Shevchenko
On Wed, Mar 22, 2023 at 02:28:04PM -0500, Bjorn Helgaas wrote: > On Mon, Mar 20, 2023 at 03:16:30PM +0200, Andy Shevchenko wrote: ... > > + pci_dev_for_each_resource_p(dev, r) { > > /* zap the 2nd function of the winbond chip */ > > - if (d

[PATCH v7 4/6] EISA: Convert to use less arguments in pci_bus_for_each_resource()

2023-03-23 Thread Andy Shevchenko
The pci_bus_for_each_resource() can hide the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- drivers/eisa/pci_eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v7 5/6] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()

2023-03-23 Thread Andy Shevchenko
The pci_bus_for_each_resource() can hide the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Acked-by: Dominik Brodowski --- drivers/pcmcia/rsrc_nonstatic.c | 9

[PATCH v7 6/6] PCI: Make use of pci_resource_n()

2023-03-23 Thread Andy Shevchenko
Replace open-coded implementations of pci_resource_n() in pci.h. Signed-off-by: Andy Shevchenko --- include/linux/pci.h | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index 70a4684d5f26..9539cf63fe5e 100644

[PATCH v7 1/6] kernel.h: Split out COUNT_ARGS() and CONCATENATE()

2023-03-23 Thread Andy Shevchenko
kernel.h is being used as a dump for all kinds of stuff for a long time. The COUNT_ARGS() and CONCATENATE() macros may be used in some places without need of the full kernel.h dependency train with it. Here is the attempt on cleaning it up by splitting out these macros(). Signed-off-by: Andy

[PATCH v7 3/6] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-03-23 Thread Andy Shevchenko
Refactor pci_bus_for_each_resource() in the same way as it's done in pci_dev_for_each_resource() case. This will allow to hide iterator inside the loop, where it's not used otherwise. No functional changes intended. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- drivers

[PATCH v7 2/6] PCI: Introduce pci_dev_for_each_resource()

2023-03-23 Thread Andy Shevchenko
. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang-format | 1 + arch/alpha/kernel/pci.c | 5 ++-- arch/arm/kernel/bios32.c | 16 ++--- arch

[PATCH v7 0/6] Add pci_dev_for_each_resource() helper and update users

2023-03-23 Thread Andy Shevchenko
by Mika, see above - added tag to pcmcia patch (Dominik) Changelog v2: - refactor to have two macros - refactor existing pci_bus_for_each_resource() in the same way and convert users Andy Shevchenko (5): kernel.h: Split out COUNT_ARGS() and CONCATENATE() PCI: Allow pci_bus_for_each_resource

Re: [PATCH v7 6/6] PCI: Make use of pci_resource_n()

2023-03-24 Thread Andy Shevchenko
On Fri, Mar 24, 2023 at 10:08:39AM +0100, Philippe Mathieu-Daudé wrote: > On 23/3/23 18:36, Andy Shevchenko wrote: > > Replace open-coded implementations of pci_resource_n() in pci.h. ... > > #define pci_resource_n(dev, bar) (&(dev)->resource[(bar)]) > > -#define

Re: [PATCH v7 4/6] EISA: Convert to use less arguments in pci_bus_for_each_resource()

2023-03-24 Thread Andy Shevchenko
On Fri, Mar 24, 2023 at 10:02:15AM +0100, Philippe Mathieu-Daudé wrote: > On 23/3/23 18:36, Andy Shevchenko wrote: > > The pci_bus_for_each_resource() can hide the iterator loop since > > it may be not used otherwise. With this, we may drop that iterator > > variable defini

[PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-03-30 Thread Andy Shevchenko
to pcmcia patch (Dominik) Changelog v2: - refactor to have two macros - refactor existing pci_bus_for_each_resource() in the same way and convert users Andy Shevchenko (6): kernel.h: Split out COUNT_ARGS() and CONCATENATE() PCI: Introduce pci_resource_n() PCI: Document pci_bus_for_each_resource

[PATCH v8 7/7] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()

2023-03-30 Thread Andy Shevchenko
The pci_bus_for_each_resource() can hide the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Acked-by: Dominik Brodowski --- drivers/pcmcia/rsrc_nonstatic.c | 9

[PATCH v8 1/7] kernel.h: Split out COUNT_ARGS() and CONCATENATE()

2023-03-30 Thread Andy Shevchenko
kernel.h is being used as a dump for all kinds of stuff for a long time. The COUNT_ARGS() and CONCATENATE() macros may be used in some places without need of the full kernel.h dependency train with it. Here is the attempt on cleaning it up by splitting out these macros(). Signed-off-by: Andy

[PATCH v8 2/7] PCI: Introduce pci_resource_n()

2023-03-30 Thread Andy Shevchenko
Introduce pci_resource_n() and replace open-coded implementations of it in pci.h. Signed-off-by: Andy Shevchenko Reviewed-by: Philippe Mathieu-Daudé --- include/linux/pci.h | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/include/linux/pci.h b/include/linux

[PATCH v8 3/7] PCI: Introduce pci_dev_for_each_resource()

2023-03-30 Thread Andy Shevchenko
. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang-format | 1 + arch/alpha/kernel/pci.c | 5 ++-- arch/arm/kernel/bios32.c | 16 ++--- arch

[PATCH v8 4/7] PCI: Document pci_bus_for_each_resource() to avoid confusion

2023-03-30 Thread Andy Shevchenko
There might be a confusion with the implementation of the pci_bus_for_each_resources() due to side effect of Logical OR. Document entire macro and explain how it works and why the conditional needs to be like that. Signed-off-by: Andy Shevchenko --- include/linux/pci.h | 20

[PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-03-30 Thread Andy Shevchenko
Refactor pci_bus_for_each_resource() in the same way as it's done in pci_dev_for_each_resource() case. This will allow to hide iterator inside the loop, where it's not used otherwise. No functional changes intended. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Reviewed

[PATCH v8 6/7] EISA: Convert to use less arguments in pci_bus_for_each_resource()

2023-03-30 Thread Andy Shevchenko
The pci_bus_for_each_resource() can hide the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Reviewed-by: Philippe Mathieu-Daudé --- drivers/eisa/pci_eisa.c | 4 ++-- 1

Re: [PATCH v7 3/6] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-03-30 Thread Andy Shevchenko
d671ebbaebfc2 ("[PATCH v7 3/6] PCI: Allow > pci_bus_for_each_resource() to take less arguments") > url: > https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/kernel-h-Split-out-COUNT_ARGS-and-CONCATENATE/20230324-013857 > base: https://git.kernel.org/cgit/

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-06 Thread Andy Shevchenko
On Wed, Apr 05, 2023 at 03:18:32PM -0500, Bjorn Helgaas wrote: > On Wed, Apr 05, 2023 at 11:28:27AM +0300, Andy Shevchenko wrote: > > On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > > > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: ..

Re: [PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:32PM +0300, Andy Shevchenko wrote: > Refactor pci_bus_for_each_resource() in the same way as it's done in > pci_dev_for_each_resource() case. This will allow to hide iterator > inside the loop, where it's not used otherwise. > > No functional changes i

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-05 Thread Andy Shevchenko
On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > Provide two new helper macros to iterate over PCI device resources and > > convert users. > > > > Looking at it, refactor existin

Re: [PATCH v8 7/7] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:34PM +0300, Andy Shevchenko wrote: ... > @@ -960,12 +960,9 @@ static int nonstatic_autoadd_resources(struct > pcmcia_socket *s) >*/ > if (s->cb_dev->bus->number == 0) > return -EINVAL; > - > - for (i =

[PATCH v6 2/4] PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource()

2023-03-20 Thread Andy Shevchenko
Refactor pci_bus_for_each_resource() in the same way as it's done in pci_dev_for_each_resource() case. This will allow to hide iterator inside the loop, where it's not used otherwise. No functional changes intended. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang

[PATCH v6 3/4] EISA: Convert to use pci_bus_for_each_resource_p()

2023-03-20 Thread Andy Shevchenko
The pci_bus_for_each_resource_p() hides the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- drivers/eisa/pci_eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v6 4/4] pcmcia: Convert to use pci_bus_for_each_resource_p()

2023-03-20 Thread Andy Shevchenko
The pci_bus_for_each_resource_p() hides the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński Acked-by: Dominik Brodowski --- drivers/pcmcia/rsrc_nonstatic.c | 9

[PATCH v6 0/4] Add pci_dev_for_each_resource() helper and update users

2023-03-20 Thread Andy Shevchenko
existing pci_bus_for_each_resource() in the same way and convert users Andy Shevchenko (3): PCI: Split pci_bus_for_each_resource_p() out of pci_bus_for_each_resource() EISA: Convert to use pci_bus_for_each_resource_p() pcmcia: Convert to use pci_bus_for_each_resource_p() Mika Westerberg

[PATCH v6 1/4] PCI: Introduce pci_dev_for_each_resource()

2023-03-20 Thread Andy Shevchenko
. Suggested-by: Andy Shevchenko Signed-off-by: Mika Westerberg Signed-off-by: Andy Shevchenko Reviewed-by: Krzysztof Wilczyński --- .clang-format | 2 ++ arch/alpha/kernel/pci.c | 5 ++-- arch/arm/kernel/bios32.c | 16

[PATCH v4 01/18] ARM: orion/gpio: Use the right include

2023-02-08 Thread Andy Shevchenko
From: Linus Walleij This is a GPIO driver so include and not the legacy header. Switch a single call to the legacy API and use as well. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/arm/plat-orion/gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH v4 04/18] gpiolib: Make the legacy consumer-only

2023-02-08 Thread Andy Shevchenko
From: Linus Walleij The legacy header was an all-inclusive header used by drivers and consumers alike. After eliminating the last users of the driver defines, we can drop the inclusion of the header. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- include/asm-generic/gpio.h

[PATCH v4 05/18] gpiolib: remove empty asm/gpio.h files

2023-02-08 Thread Andy Shevchenko
as the only gpio driver that needs something custom for gpiolib. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko Reviewed-by: Vincenzo Palazzo --- arch/arm/Kconfig

[PATCH v4 16/18] gpiolib: Deduplicate forward declarations in consumer.h

2023-02-08 Thread Andy Shevchenko
The struct fwnode_handle pointer is used in both branches of ifdeffery, no need to have a copy of the same in each of them, just make it global. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include

[PATCH v4 06/18] gpiolib: coldfire: remove custom asm/gpio.h

2023-02-08 Thread Andy Shevchenko
is even less useful, as it is guarded by an #ifdef that is never true. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/m68k/Kconfig.cpu| 1

[PATCH v4 07/18] gpiolib: remove asm-generic/gpio.h

2023-02-08 Thread Andy Shevchenko
From: Arnd Bergmann The asm-generic/gpio.h file is now always included when using gpiolib, so just move its contents into linux/gpio.h with a few minor simplifications. Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko

[PATCH v4 10/18] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-08 Thread Andy Shevchenko
From: Arnd Bergmann Almost all gpio drivers include linux/gpio/driver.h, and other files should not rely on includes from this header. Remove the indirect include from here and include the correct headers directly from where they are used. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd

[PATCH v4 12/18] gpio: aggregator: Add missing header(s)

2023-02-08 Thread Andy Shevchenko
Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, drop unused linux/gpio.h and split out the GPIO group of headers. Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven --- drivers/gpio/gpio

[PATCH v4 02/18] ARM: s3c24xx: Use the right include

2023-02-08 Thread Andy Shevchenko
From: Linus Walleij The file s3c64xx.c is including despite using no symbols from the file, however it needs it to implicitly bring in of_have_populated_dt() so include explicitly instead. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/arm/mach-s3c/s3c64xx.c | 2 +- 1

[PATCH v4 14/18] gpio: regmap: Add missing header(s)

2023-02-08 Thread Andy Shevchenko
Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, split out the GPIO group of headers. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-regmap.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v4 13/18] gpio: reg: Add missing header(s)

2023-02-08 Thread Andy Shevchenko
Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. While at it, split out the GPIO group of headers. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-reg.c | 12 ++-- 1 file changed, 10 insertions(+), 2

[PATCH v4 15/18] gpiolib: Drop unused forward declaration from driver.h

2023-02-08 Thread Andy Shevchenko
There is no struct device_node pointers anywhere in the header, drop unused forward declaration. Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index ccd8a512d854

[PATCH v4 09/18] gpiolib: remove legacy gpio_export()

2023-02-08 Thread Andy Shevchenko
From: Arnd Bergmann There are only a handful of users of gpio_export() and related functions. As these are just wrappers around the modern gpiod_export() helper, remove the wrappers and open-code the gpio_to_desc in all callers to shrink the legacy API. Reviewed-by: Andy Shevchenko Signed-off

[PATCH v4 00/18] gpiolib cleanups

2023-02-08 Thread Andy Shevchenko
was merged - rebase on latest gpio tree - leave unused gpio_cansleep() in place for now - address feedback from Andy Shevchenko Andy Shevchenko (7): gpio: aggregator: Add missing header(s) gpio: reg: Add missing header(s) gpio: regmap: Add missing header(s) gpiolib: Drop unused forward

[PATCH v4 08/18] gpiolib: remove gpio_set_debounce()

2023-02-08 Thread Andy Shevchenko
From: Arnd Bergmann gpio_set_debounce() only has a single user, which is trivially converted to gpiod_set_debounce(). Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko --- Documentation/driver-api/gpio/legacy.rst

[PATCH v4 03/18] hte: tegra-194: Use proper includes

2023-02-08 Thread Andy Shevchenko
) and sort the headers. Signed-off-by: Linus Walleij Signed-off-by: Andy Shevchenko --- drivers/hte/hte-tegra194-test.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hte/hte-tegra194-test.c b/drivers/hte/hte-tegra194-test.c index 5d776a185bd6..358d4a10c6a1

[PATCH v4 18/18] gpiolib: Clean up headers

2023-02-08 Thread Andy Shevchenko
There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - group generic headers and subsystem headers - sort each group alphabetically Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib

[PATCH v4 17/18] gpiolib: Group forward declarations in consumer.h

2023-02-08 Thread Andy Shevchenko
For better maintenance group the forward declarations together. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index a7eb8aa1e54c..5432e5d5fbfb

Re: [PATCH v4 02/18] ARM: s3c24xx: Use the right include

2023-02-08 Thread Andy Shevchenko
On Wed, Feb 08, 2023 at 06:39:12PM +0100, Krzysztof Kozlowski wrote: > On 08/02/2023 18:33, Andy Shevchenko wrote: ... > It's not s3c24xx anymore, so subject prefix: > ARM: s3c64xx: Fixed locally, thanks. -- With Best Regards, Andy Shevchenko

[PATCH v4 11/18] gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h

2023-02-08 Thread Andy Shevchenko
From: Arnd Bergmann This is a rarely used feature that has nothing to do with the client-side of_gpio.h. Split it out with a separate header file and Kconfig option so it can be removed on its own timeline aside from removing the of_gpio consumer interfaces. Reviewed-by: Andy Shevchenko

[PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann Almost all gpio drivers include linux/gpio/driver.h, and other files should not rely on includes from this header. Remove the indirect include from here and include the correct headers directly from where they are used. Reviewed-by: Andy Shevchenko Signed-off-by: Arnd

[PATCH v3 10/12] gpiolib: Deduplicate forward declarations in consumer.h

2023-02-07 Thread Andy Shevchenko
The struct fwnode_handle pointer is used in both branches of ifdeffery, no need to have a copy of the same in each of them, just make it global. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include

[PATCH v3 05/12] gpiolib: remove legacy gpio_export

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann There are only a handful of users of gpio_export() and related functions. As these are just wrappers around the modern gpiod_export() helper, remove the wrappers and open-code the gpio_to_desc in all callers to shrink the legacy API. Reviewed-by: Andy Shevchenko Signed-off

[PATCH v3 04/12] gpiolib: remove gpio_set_debounce

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann gpio_set_debounce() only has a single user, which is trivially converted to gpiod_set_debounce(). Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko --- Documentation/driver-api/gpio/legacy.rst | 2

[PATCH v3 02/12] gpiolib: coldfire: remove custom asm/gpio.h

2023-02-07 Thread Andy Shevchenko
is even less useful, as it is guarded by an #ifdef that is never true. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/m68k/Kconfig.cpu| 1

[PATCH v3 12/12] gpiolib: Clean up headers

2023-02-07 Thread Andy Shevchenko
There is a few things done: - include only the headers we are direct user of - when pointer is in use, provide a forward declaration - add missing headers - group generic headers and subsystem headers - sort each group alphabetically Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib

[PATCH v3 00/12] gpiolib cleanups

2023-02-07 Thread Andy Shevchenko
for now - address feedback from Andy Shevchenko Andy Shevchenko (5): gpio: aggregator: Add missing header(s) gpiolib: Drop unused forward declaration from driver.h gpiolib: Deduplicate forward declarations in consumer.h gpiolib: Group forward declarations in consumer.h gpiolib: Clean up

[PATCH v3 03/12] gpiolib: remove asm-generic/gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann The asm-generic/gpio.h file is now always included when using gpiolib, so just move its contents into linux/gpio.h with a few minor simplifications. Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko

[PATCH v3 01/12] gpiolib: remove empty asm/gpio.h files

2023-02-07 Thread Andy Shevchenko
as the only gpio driver that needs something custom for gpiolib. Reviewed-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Andy Shevchenko --- arch/arm/Kconfig| 1 - arch

[PATCH v3 07/12] gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h

2023-02-07 Thread Andy Shevchenko
From: Arnd Bergmann This is a rarely used feature that has nothing to do with the client-side of_gpio.h. Split it out with a separate header file and Kconfig option so it can be removed on its own timeline aside from removing the of_gpio consumer interfaces. Reviewed-by: Andy Shevchenko

[PATCH v3 11/12] gpiolib: Group forward declarations in consumer.h

2023-02-07 Thread Andy Shevchenko
For better maintenance group the forward declarations together. Signed-off-by: Andy Shevchenko --- include/linux/gpio/consumer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index a7eb8aa1e54c..5432e5d5fbfb

[PATCH v3 09/12] gpiolib: Drop unused forward declaration from driver.h

2023-02-07 Thread Andy Shevchenko
There is no struct device_node pointers anywhere in the header, drop unused forward declaration. Signed-off-by: Andy Shevchenko --- include/linux/gpio/driver.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index ccd8a512d854

[PATCH v3 08/12] gpio: aggregator: Add missing header(s)

2023-02-07 Thread Andy Shevchenko
Do not imply that some of the generic headers may be always included. Instead, include explicitly what we are direct user of. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-aggregator.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio

Re: [PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-07 Thread Andy Shevchenko
On Tue, Feb 07, 2023 at 03:55:23PM +0100, Linus Walleij wrote: > On Tue, Feb 7, 2023 at 3:29 PM Andy Shevchenko > wrote: > > > From: Arnd Bergmann > > > > Almost all gpio drivers include linux/gpio/driver.h, and other > > files should not rely on includes

Re: [PATCH v3 04/12] gpiolib: remove gpio_set_debounce

2023-02-07 Thread Andy Shevchenko
On Tue, Feb 07, 2023 at 01:32:01PM -0800, Dmitry Torokhov wrote: > On Tue, Feb 07, 2023 at 04:29:44PM +0200, Andy Shevchenko wrote: > > @@ -1010,14 +1009,21 @@ static int ads7846_setup_pendown(struct spi_device > > *spi, > > } > > > >

Re: [PATCH v3 06/12] gpiolib: split linux/gpio/driver.h out of linux/gpio.h

2023-02-08 Thread Andy Shevchenko
On Wed, Feb 08, 2023 at 12:55:06AM +0200, Andy Shevchenko wrote: > On Tue, Feb 07, 2023 at 03:55:23PM +0100, Linus Walleij wrote: > > On Tue, Feb 7, 2023 at 3:29 PM Andy Shevchenko > > wrote: > > > > > From: Arnd Bergmann > > > > > > Alm

Re: [PATCH v4 00/18] gpiolib cleanups

2023-02-15 Thread Andy Shevchenko
On Wed, Feb 15, 2023 at 04:52:29PM +0100, Bartosz Golaszewski wrote: > On Wed, Feb 8, 2023 at 6:34 PM Andy Shevchenko > wrote: > > > > These are some older patches Arnd did last year, rebased to > > linux-next-20230208. On top there are Andy's patches regarding >

Re: [PATCH] platforms: 52xx: Remove space after '(' and before ')'

2023-07-18 Thread Andy Shevchenko
Also note, you can move this to use pci_match_id(). That kind of patch might be approved. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-01 Thread Andy Shevchenko
On Thu, Jun 01, 2023 at 07:25:46PM +0300, Andy Shevchenko wrote: > On Wed, May 31, 2023 at 08:48:35PM +0200, Jonas Gorski wrote: > > On Tue, 30 May 2023 at 23:34, Bjorn Helgaas wrote: > > > On Fri, May 12, 2023 at 02:48:51PM -0500, Bjorn Helgaas wrote: ... > > > Whe

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-01 Thread Andy Shevchenko
On Wed, May 31, 2023 at 08:48:35PM +0200, Jonas Gorski wrote: > On Tue, 30 May 2023 at 23:34, Bjorn Helgaas wrote: > > On Fri, May 12, 2023 at 02:48:51PM -0500, Bjorn Helgaas wrote: > > > On Fri, May 12, 2023 at 01:56:29PM +0300, Andy Shevchenko wrote: > > > > On T

Re: [PATCH v3 2/2] serial: 8250: Apply FSL workarounds also without SERIAL_8250_CONSOLE

2023-06-05 Thread Andy Shevchenko
sl.o[1]. > > So in my book a bool SERIAL_8250_FSL that modifies 8250_base.ko (with > > SERIAL_8250=m) is fine. > > [1] 8250_port.o uses fsl8250_handle_irq() from 8250_fsl.o > > Is that after some fix which isn't in tty-next? I see only these: > > $ git grep -l fsl8250_handle_irq > arch/powerpc/kernel/legacy_serial.c > drivers/tty/serial/8250/8250_fsl.c > drivers/tty/serial/8250/8250_of.c > include/linux/serial_8250.h > > No users of fsl8250_handle_irq in 8250_port.c. > >, and 8250_fsl.o uses serial8250_modem_status from 8250_port.o. I don't like 8250_base to be fattened by some stuff that has no generic meaning. Can we avoid putting every quirk there? -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-05 Thread Andy Shevchenko
ot for looking into this! I think you're right, and I think > the rewritten expression is more logical as well. Do you want to post > a patch for it? Gimme some time, I was on a long leave and now it's a pile to handle. -- With Best Regards, Andy Shevchenko

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-05-12 Thread Andy Shevchenko
On Tue, May 09, 2023 at 01:21:22PM -0500, Bjorn Helgaas wrote: > On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > > Provide two new helper macros to iterate over PCI device resources and &

Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users

2024-02-15 Thread Andy Shevchenko
an replace it with bitmap_scatter() (IIUC) with explanation that the former 1) uses atomic ops while being non-atomic as a whole, and b) having quite hard to get documentation. At least that's how I see it, I mean that I would like to leave bitmap_onto() alone and address it separately. > Yury, any preferences ? -- With Best Regards, Andy Shevchenko

Re: [DMARC error][SPF error] Re: [PATCH v4 00/10] devm_led_classdev_register() usage problem

2024-02-13 Thread Andy Shevchenko
On Tue, Feb 13, 2024 at 2:14 AM George Stark wrote: > > Hello Andy > > On 2/12/24 12:53, Andy Shevchenko wrote: > > On Mon, Feb 12, 2024 at 1:52 AM George Stark > > wrote: > >> I haven't lose hope for the devm_mutex thing and keep pinging those guys > &

Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users

2024-02-21 Thread Andy Shevchenko
On Wed, Feb 21, 2024 at 02:44:31PM +0100, Herve Codina wrote: > On Thu, 15 Feb 2024 21:17:23 +0200 > Andy Shevchenko wrote: [...] > > > Now what's the plan ? > > > Andy, do you want to send a v2 of this patch or may I get the patch, > > > modify it > >

Re: [DMARC error][SPF error] Re: [PATCH v4 00/10] devm_led_classdev_register() usage problem

2024-02-12 Thread Andy Shevchenko
ersion into your series. Am I wrong? > Sure I can single out the fix-only patch I'll do it tomorrow. I believe it can be handled without issuing it separately. `b4` tool is capable of selective choices. It was rather Q to Lee if he can/want to apply it right away. > On 2/9/24 20:11, And

Re: [PATCH v4 00/10] devm_led_classdev_register() usage problem

2024-02-09 Thread Andy Shevchenko
[2] > > https://lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895...@salutedevices.com/T/#mc132b9b350fa51931b4fcfe14705d9f06e91421f > > [3] > > https://lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895...@salutedevices.com/T/#mdbf572a85c33f869a553caf986b6228bb65c

Re: [PATCH v4 00/10] devm_led_classdev_register() usage problem

2024-02-09 Thread Andy Shevchenko
/lore.kernel.org/lkml/8704539b-ed3b-44e6-aa82-586e2f895...@salutedevices.com/T/#mdbf572a85c33f869a553caf986b6228bb65c8383 Are you going to send an updated version with the amended second patch? -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users

2024-02-12 Thread Andy Shevchenko
On Mon, Feb 12, 2024 at 03:20:22PM +0100, Herve Codina wrote: > On Mon, 12 Feb 2024 16:01:38 +0200 > Andy Shevchenko wrote: ... > Agree, the bitmap_onto() code is simpler to understand than its help. > > I introduced bitmap_off() to be the "reverse" bitmap_onto() ope

Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users

2024-02-12 Thread Andy Shevchenko
On Mon, Feb 12, 2024 at 02:37:53PM +0100, Herve Codina wrote: > On Mon, 12 Feb 2024 14:27:16 +0200 > Andy Shevchenko wrote: > > On Mon, Feb 12, 2024 at 08:56:31AM +0100, Herve Codina wrote: > > > Currently the bitmap_onto() is available only for CONFIG_NUMA=y case, >

Re: [PATCH v3 RESEND 1/6] net: wan: Add support for QMC HDLC

2024-02-12 Thread Andy Shevchenko
these are being used, am I right? What's is missing OTOH is the mod_devicetable.h. > +#include > +#include + Blank line? > +#include -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users

2024-02-12 Thread Andy Shevchenko
y and exporting for > modules. Wondering if you are trying to have something like https://lore.kernel.org/lkml/20230926052007.3917389-1-andriy.shevche...@linux.intel.com/ -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 03/11] devm-helpers: introduce devm_mutex_init

2023-12-13 Thread Andy Shevchenko
dev, struct mutex *lock) > +{ > + mutex_init(lock); > +#ifdef mutex_destroy > + return devm_add_action_or_reset(dev, devm_mutex_release, lock); > +#else > + return 0; > +#endif > +} If this is going to be accepted, you may decrease the amount of ifdeffery. #

Re: [PATCH v3 03/11] devm-helpers: introduce devm_mutex_init

2023-12-13 Thread Andy Shevchenko
On Thu, Dec 14, 2023 at 12:36 AM Andy Shevchenko wrote: > On Thu, Dec 14, 2023 at 12:30 AM George Stark > wrote: > > > > Using of devm API leads to a certain order of releasing resources. > > So all dependent resources which are not devm-wrapped should be deleted

Re: [PATCH RFC v4-bis] locking: introduce devm_mutex_init

2023-12-15 Thread Andy Shevchenko
*lock); > +int devm_mutex_init(struct device *dev, struct mutex *lock); > +#else > +static inline void mutex_destroy(struct mutex *lock) {} > + > +static inline int devm_mutex_init(struct device *dev, struct mutex *lock) > +{ > + mutex_init(lock); > + return 0; > +} > +#endif -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 04/11] leds: aw2013: use devm API to cleanup module's resources

2023-12-14 Thread Andy Shevchenko
series #3 are online. Nikita is right. This patch was the last in the mailing lists. Fix your mail gateways, it quite likely the mail server in your organisation filters out some mails as spam or so. I highly recommend to escalate this with your IT department. -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 03/11] devm-helpers: introduce devm_mutex_init

2023-12-14 Thread Andy Shevchenko
to be in the very same _C_-file where mutex_destroy() is defined. mutex.h in this case indeed requires the only forward declaration and hence doesn't need to include device.h. -- With Best Regards, Andy Shevchenko

Re: [PATCH 0/8] devm_led_classdev_register() usage problem

2023-11-24 Thread Andy Shevchenko
ases it doesn't really need to turn off the leds manually > one-by-one > if driver shutdowns whole led controller. For the last case to disable the > warning > new flag can be brought in e.g LED_AUTO_OFF_AT_SHUTDOWN (similar to > LED_RETAIN_AT_SHUTDOWN). NAK. Just fix the drivers by wrapping mutex_destroy() into devm, There are many doing so. You may be brave enough to introduce devm_mutex_init() somewhere in include/linux/device* -- With Best Regards, Andy Shevchenko

Re: [PATCH 0/8] devm_led_classdev_register() usage problem

2023-11-24 Thread Andy Shevchenko
ckly reading it seems to be a wrong approach (or wrong end to start solving the issue from). -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-04 Thread Andy Shevchenko
lers are sane and generate better code against > properly annotated data, the above discrepancy doesn't look weird. When > running on non-volatile bitmaps, plain find_bit() outperforms atomic > find_and_bit(), and vice-versa. ... In some cases the better improvements can be achieved by switching the (very) old code to utilise IDA framework. -- With Best Regards, Andy Shevchenko

<    1   2   3   4   5   >