Message ID | 20200919221548.29984-1-marek.behun@nic.cz |
---|---|
Headers | show |
Series | leds: tca6507 cleanup | expand |
This patch should also remove the use of of_match_ptr, since the definition of variable of_tca6507_leds_match isn't guarded by CONFIG_OF anymore. (If kernel test robot enables this driver but disables CONFIG_OF, a warning will be issued). Pavel, should I respin this, or send another patch afterwards? Marek
> Am 20.09.2020 um 00:15 schrieb Marek Behún <marek.behun@nic.cz>: > > The only in-tree usage of this driver is via device-tree. No on else > includes linux/leds-tca6507.h, so absorb the definition of platdata > structure. > > Signed-off-by: Marek Behún <marek.behun@nic.cz> > Cc: NeilBrown <neilb@suse.de> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: H. Nikolaus Schaller <hns@goldelico.com> Tested-by: H. Nikolaus Schaller <hns@goldelico.com> on GTA04 (omap3-gta04.dtsi). > --- > drivers/leds/leds-tca6507.c | 11 ++++++++++- > include/linux/leds-tca6507.h | 21 --------------------- > 2 files changed, 10 insertions(+), 22 deletions(-) > delete mode 100644 include/linux/leds-tca6507.h > > diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c > index a7e9fd85b6dd5..b5b5bafe2176e 100644 > --- a/drivers/leds/leds-tca6507.c > +++ b/drivers/leds/leds-tca6507.c > @@ -95,7 +95,6 @@ > #include <linux/i2c.h> > #include <linux/gpio/driver.h> > #include <linux/workqueue.h> > -#include <linux/leds-tca6507.h> > #include <linux/of.h> > > /* LED select registers determine the source that drives LED outputs */ > @@ -108,6 +107,16 @@ > #define TCA6507_LS_BLINK0 0x6 /* Blink at Bank0 rate */ > #define TCA6507_LS_BLINK1 0x7 /* Blink at Bank1 rate */ > > +struct tca6507_platform_data { > + struct led_platform_data leds; > +#ifdef CONFIG_GPIOLIB > + int gpio_base; > + void (*setup)(unsigned gpio_base, unsigned ngpio); > +#endif > +}; > + > +#define TCA6507_MAKE_GPIO 1 > + > enum { > BANK0, > BANK1, > diff --git a/include/linux/leds-tca6507.h b/include/linux/leds-tca6507.h > deleted file mode 100644 > index 50d330ed11005..0000000000000 > --- a/include/linux/leds-tca6507.h > +++ /dev/null > @@ -1,21 +0,0 @@ > -/* SPDX-License-Identifier: GPL-2.0-only */ > -/* > - * TCA6507 LED chip driver. > - * > - * Copyright (C) 2011 Neil Brown <neil@brown.name> > - */ > - > -#ifndef __LINUX_TCA6507_H > -#define __LINUX_TCA6507_H > -#include <linux/leds.h> > - > -struct tca6507_platform_data { > - struct led_platform_data leds; > -#ifdef CONFIG_GPIOLIB > - int gpio_base; > - void (*setup)(unsigned gpio_base, unsigned ngpio); > -#endif > -}; > - > -#define TCA6507_MAKE_GPIO 1 > -#endif /* __LINUX_TCA6507_H*/ > -- > 2.26.2 >
On Sun, 20 Sep 2020 19:10:19 +0200 H. Nikolaus Schaller <hns@goldelico.com> wrote: > I wanted to test, but was not able to git am this patch to my working > environment (v5.9-rc5 or linux-next). So maybe some prerequisite is missing. Could you try applying on Pavel's for-next? https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/log/?h=for-next Marek
On Sun, 20 Sep 2020 19:35:03 +0200 Marek Behun <marek.behun@nic.cz> wrote: > On Sun, 20 Sep 2020 19:10:19 +0200 > H. Nikolaus Schaller <hns@goldelico.com> wrote: > > > I wanted to test, but was not able to git am this patch to my working > > environment (v5.9-rc5 or linux-next). So maybe some prerequisite is missing. > > Could you try applying on Pavel's for-next? > > https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/log/?h=for-next > > Marek Or even better, could you try my branch leds-cleanup-for-pavel? This is applied on top of Pavel's for-next branch. https://git.kernel.org/pub/scm/linux/kernel/git/kabel/linux.git/log/?h=leds-cleanup-for-pavel Marek Marek
> Am 20.09.2020 um 19:39 schrieb Marek Behun <marek.behun@nic.cz>: > > On Sun, 20 Sep 2020 19:35:03 +0200 > Marek Behun <marek.behun@nic.cz> wrote: > >> On Sun, 20 Sep 2020 19:10:19 +0200 >> H. Nikolaus Schaller <hns@goldelico.com> wrote: >> >>> I wanted to test, but was not able to git am this patch to my working >>> environment (v5.9-rc5 or linux-next). So maybe some prerequisite is missing. >> >> Could you try applying on Pavel's for-next? >> >> https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/log/?h=for-next >> >> Marek > > Or even better, could you try my branch leds-cleanup-for-pavel? This is > applied on top of Pavel's for-next branch. > > https://git.kernel.org/pub/scm/linux/kernel/git/kabel/linux.git/log/?h=leds-cleanup-for-pavel Ok, seems to depend on: leds: various: use only available OF children leds: various: use dev_of_node(dev) instead of dev->of_node Will try tomorrow. BR and thanks, Nikolaus
> Am 20.09.2020 um 20:09 schrieb H. Nikolaus Schaller <hns@goldelico.com>: > > >> Am 20.09.2020 um 19:39 schrieb Marek Behun <marek.behun@nic.cz>: >> >> On Sun, 20 Sep 2020 19:35:03 +0200 >> Marek Behun <marek.behun@nic.cz> wrote: >> >>> On Sun, 20 Sep 2020 19:10:19 +0200 >>> H. Nikolaus Schaller <hns@goldelico.com> wrote: >>> >>>> I wanted to test, but was not able to git am this patch to my working >>>> environment (v5.9-rc5 or linux-next). So maybe some prerequisite is missing. >>> >>> Could you try applying on Pavel's for-next? >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git/log/?h=for-next >>> >>> Marek >> >> Or even better, could you try my branch leds-cleanup-for-pavel? This is >> applied on top of Pavel's for-next branch. >> >> https://git.kernel.org/pub/scm/linux/kernel/git/kabel/linux.git/log/?h=leds-cleanup-for-pavel > > Ok, seems to depend on: > > leds: various: use only available OF children > leds: various: use dev_of_node(dev) instead of dev->of_node > > Will try tomorrow. Ok, I have not found a negative effect on GTA04... Well, it only uses DT for ages. BR, Nikolaus
Hi! > > leds: various: use only available OF children > > leds: various: use dev_of_node(dev) instead of dev->of_node > > > > Will try tomorrow. > > Ok, I have not found a negative effect on GTA04... > Well, it only uses DT for ages. Thanks, I applied 1 and 2 of the series. Device tree and documentation changes are not really for me (I can take the documentation ones if I get and ack). The rest does not look bad, but I would not mind someone testing them. Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
On Sun, Sep 20, 2020 at 12:15 AM Marek Behún <marek.behun@nic.cz> wrote: > The only in-tree usage of this driver is via device-tree. No on else > includes linux/leds-tca6507.h, so absorb the definition of platdata > structure. > > Signed-off-by: Marek Behún <marek.behun@nic.cz> > Cc: NeilBrown <neilb@suse.de> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: H. Nikolaus Schaller <hns@goldelico.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
Hi! > if (fwnode_property_match_string(child, "compatible", > "gpio") >= 0) { > gpio_bitmap |= BIT(reg); > continue; > + } else { > + led_bitmap |= BIT(reg); > } > You have "continue" above, so you don't really need the else branch. Thanks, Pavel