* Re: [PATCH RFC v4 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors
[not found] ` <20231001-pxa-gpio-v4-1-0f3b975e6ed5@skole.hr>
@ 2023-10-01 14:32 ` Andy Shevchenko
2023-10-01 18:39 ` Duje Mihanović
0 siblings, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2023-10-01 14:32 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> Sharp's Spitz board still uses the legacy GPIO interface for controlling
> a GPIO pin related to the USB host controller.
>
> Convert this function to use the new GPIO descriptor interface.
...
> + pxa_ohci->usb_host = gpiod_get_optional(&pdev->dev, "usb-host", GPIOD_OUT_LOW);
> + if (IS_ERR(pxa_ohci->usb_host))
> + dev_warn(&pdev->dev, "failed to get USB host GPIO with %pe\n",
> + pxa_ohci->usb_host);
Since you are using _optional() API, you need to bail out on the error
case and replace dev_warn() by dev_err(). I guess I already commented
on this. What is the rationale to not follow my comment?
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors
[not found] ` <20231001-pxa-gpio-v4-2-0f3b975e6ed5@skole.hr>
@ 2023-10-01 14:34 ` Andy Shevchenko
2023-10-02 7:36 ` Bartosz Golaszewski
2023-10-02 8:54 ` Linus Walleij
1 sibling, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2023-10-01 14:34 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> Sharp's Spitz board still uses the legacy GPIO interface for configuring
> its two onboard LEDs.
>
> Convert them to use the GPIO descriptor interface.
...
> static void __init spitz_leds_init(void)
> {
> + gpiod_add_lookup_table(&spitz_led_gpio_table);
> platform_device_register(&spitz_led_device);
> + spitz_gpio_leds[0].gpiod = gpiod_get_index(&spitz_led_device.dev,
> + NULL, 0, GPIOD_ASIS);
> + spitz_gpio_leds[1].gpiod = gpiod_get_index(&spitz_led_device.dev,
> + NULL, 1, GPIOD_ASIS);
> }
What's the point of keeping a lookup table after we got descriptors out of it?
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 4/6] ARM: pxa: Convert reset driver to GPIO descriptors
[not found] ` <20231001-pxa-gpio-v4-4-0f3b975e6ed5@skole.hr>
@ 2023-10-01 14:40 ` Andy Shevchenko
2023-10-01 14:50 ` Andy Shevchenko
0 siblings, 1 reply; 13+ messages in thread
From: Andy Shevchenko @ 2023-10-01 14:40 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> The PXA reset driver still uses the legacy GPIO interface for
> configuring and asserting the reset pin.
>
> Convert it to use the GPIO descriptor interface.
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
I dunno how.
...
> + reset_gpio = gpiod_get(NULL, "reset generator", GPIOD_ASIS);
> + if (IS_ERR(reset_gpio)) {
> + pr_err("Can't request reset_gpio: %pe\n", reset_gpio);
> + return PTR_ERR(reset_gpio);
> }
Here you asked for the GPIO named as "reset generator-gpio(s)" (The
"(s)" part is for new bindings), but you must not use spaces in the
GPIO names. Moreover the string literal there is for labeling, and not
for matching.
...
> +GPIO_LOOKUP_SINGLE(spitz_reset_gpio_table, NULL, "pxa-gpio",
And here should be gpios. That's what you have to request, but because
of the global (device-less) nature of this, you have to be very
careful to avoid any clashes.
> + SPITZ_GPIO_ON_RESET, "reset generator", GPIO_ACTIVE_HIGH);
...
TBH, I don't know how it is supposed to work with your current code
and if Linus really was okay with this.
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 4/6] ARM: pxa: Convert reset driver to GPIO descriptors
2023-10-01 14:40 ` [PATCH RFC v4 4/6] ARM: pxa: Convert reset driver " Andy Shevchenko
@ 2023-10-01 14:50 ` Andy Shevchenko
0 siblings, 0 replies; 13+ messages in thread
From: Andy Shevchenko @ 2023-10-01 14:50 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On Sun, Oct 1, 2023 at 5:40 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
...
> TBH, I don't know how it is supposed to work with your current code
> and if Linus really was okay with this.
Okay, it seems I have to refresh my memories about GPIO lookup tables.
First of all, we indeed require a connection ID just to match and no
matter if it has or hasn't the suffix.Second, the key is a label of
the GPIO controller according to the device driver (device tree?) and
pxa-gpio is that one. Seems it should work.
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver
[not found] ` <20231001-pxa-gpio-v4-6-0f3b975e6ed5@skole.hr>
@ 2023-10-01 14:56 ` Andy Shevchenko
2023-10-02 8:59 ` Linus Walleij
2023-10-02 11:39 ` Mark Brown
2 siblings, 0 replies; 13+ messages in thread
From: Andy Shevchenko @ 2023-10-01 14:56 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> If this code is left in the board file, the sync GPIO would have to be
> separated into another lookup table during conversion to the GPIO
> descriptor API (which is also done in this patch).
>
> The only user of this code (Sharp Spitz) is also converted in this
> patch.
Suggested-by: Linus... ?
...
> +static void ads7846_wait_for_sync(struct ads7846 *ts)
I would name it ..._wait_for_sync_gpio.
...
> + ts->sync = devm_gpiod_get_optional(dev, "sync", GPIOD_IN);
> + if (IS_ERR(ts->sync)) {
> + dev_err(dev, "Failed to get sync GPIO: %pe\n", ts->sync);
> + return PTR_ERR(ts->sync);
return dev_err_probe(...); ?
> + }
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors
2023-10-01 14:32 ` [PATCH RFC v4 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors Andy Shevchenko
@ 2023-10-01 18:39 ` Duje Mihanović
0 siblings, 0 replies; 13+ messages in thread
From: Duje Mihanović @ 2023-10-01 18:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov, Mark Brown,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
On 10/1/2023 4:32 PM, Andy Shevchenko wrote:
>> + pxa_ohci->usb_host = gpiod_get_optional(&pdev->dev, "usb-host", GPIOD_OUT_LOW);
>> + if (IS_ERR(pxa_ohci->usb_host))
>> + dev_warn(&pdev->dev, "failed to get USB host GPIO with %pe\n",
>> + pxa_ohci->usb_host);
>
> Since you are using _optional() API, you need to bail out on the error
> case and replace dev_warn() by dev_err(). I guess I already commented
> on this. What is the rationale to not follow my comment?
I must have missed it, sorry about that. I'll be sure to do so in v5.
Regards,
Duje
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors
2023-10-01 14:34 ` [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs " Andy Shevchenko
@ 2023-10-02 7:36 ` Bartosz Golaszewski
0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-10-02 7:36 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Duje Mihanović, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Russell King, Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Andy Shevchenko, Dmitry Torokhov, Mark Brown, linux-arm-kernel,
linux-kernel, linux-usb, linux-gpio, linux-input, linux-spi
On Sun, Oct 1, 2023 at 4:35 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Sun, Oct 1, 2023 at 5:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
> >
> > Sharp's Spitz board still uses the legacy GPIO interface for configuring
> > its two onboard LEDs.
> >
> > Convert them to use the GPIO descriptor interface.
>
> ...
>
> > static void __init spitz_leds_init(void)
> > {
> > + gpiod_add_lookup_table(&spitz_led_gpio_table);
> > platform_device_register(&spitz_led_device);
> > + spitz_gpio_leds[0].gpiod = gpiod_get_index(&spitz_led_device.dev,
> > + NULL, 0, GPIOD_ASIS);
> > + spitz_gpio_leds[1].gpiod = gpiod_get_index(&spitz_led_device.dev,
> > + NULL, 1, GPIOD_ASIS);
> > }
>
> What's the point of keeping a lookup table after we got descriptors out of it?
>
Normally the descriptors would be retrieved in drivers and so lookup
tables should stay in memory forever as static resources (just like
device-tree). We have recently added some "temporary" lookup tables to
address even worse hacks. The tables would be removed immediately
after the descriptor is retrieved simply because we used that hack in
drivers which may be unbound and re-bound resulting in adding
repeating lookup entries.
Here we're dealing with a board-file so a more classic approach of
having static lookup tables added once and never removed is in order.
So I'd leave it like this.
Bart
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 5/6] ARM: pxa: Convert gumstix Bluetooth to GPIO descriptors
[not found] ` <20231001-pxa-gpio-v4-5-0f3b975e6ed5@skole.hr>
@ 2023-10-02 7:42 ` Bartosz Golaszewski
2023-10-02 14:52 ` Duje Mihanović
0 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-10-02 7:42 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij, Andy Shevchenko,
Dmitry Torokhov, Mark Brown, linux-arm-kernel, linux-kernel,
linux-usb, linux-gpio, linux-input, linux-spi
On Sun, Oct 1, 2023 at 4:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> Gumstix still uses the legacy GPIO interface for resetting the Bluetooth
> device.
>
> Convert it to use the GPIO descriptor interface.
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
> ---
> arch/arm/mach-pxa/gumstix.c | 24 +++++++++++++-----------
> 1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
> index c9f0f62187bd..14e1b9274d7a 100644
> --- a/arch/arm/mach-pxa/gumstix.c
> +++ b/arch/arm/mach-pxa/gumstix.c
> @@ -20,8 +20,8 @@
> #include <linux/delay.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/partitions.h>
> +#include <linux/gpio/consumer.h>
> #include <linux/gpio/machine.h>
> -#include <linux/gpio.h>
> #include <linux/err.h>
> #include <linux/clk.h>
>
> @@ -129,6 +129,9 @@ static void gumstix_udc_init(void)
> #endif
>
> #ifdef CONFIG_BT
> +GPIO_LOOKUP_SINGLE(gumstix_bt_gpio_table, "pxa2xx-uart.1", "pxa-gpio",
> + GPIO_GUMSTIX_BTRESET, "BTRST", GPIO_ACTIVE_LOW);
> +
> /* Normally, the bootloader would have enabled this 32kHz clock but many
> ** boards still have u-boot 1.1.4 so we check if it has been turned on and
> ** if not, we turn it on with a warning message. */
> @@ -153,24 +156,23 @@ static void gumstix_setup_bt_clock(void)
>
> static void __init gumstix_bluetooth_init(void)
> {
> - int err;
> + struct gpio_desc *desc;
> +
> + gpiod_add_lookup_table(&gumstix_bt_gpio_table);
>
> gumstix_setup_bt_clock();
>
> - err = gpio_request(GPIO_GUMSTIX_BTRESET, "BTRST");
> - if (err) {
> + desc = gpiod_get(&pxa_device_btuart.dev, "BTRST", GPIOD_OUT_HIGH);
> + if (IS_ERR(desc)) {
> pr_err("gumstix: failed request gpio for bluetooth reset\n");
> return;
> }
>
> - err = gpio_direction_output(GPIO_GUMSTIX_BTRESET, 1);
> - if (err) {
> - pr_err("gumstix: can't reset bluetooth\n");
> - return;
> - }
> - gpio_set_value(GPIO_GUMSTIX_BTRESET, 0);
> + gpiod_set_value(desc, 0);
> udelay(100);
> - gpio_set_value(GPIO_GUMSTIX_BTRESET, 1);
> + gpiod_set_value(desc, 1);
> +
> + gpiod_put(desc);
This changes the way this code works. You release the descriptor here,
it returns to the driver and can be re-requested by someone else. Its
value is also not guaranteed to remain as "active". Is this what you
want?
Bart
> }
> #else
> static void gumstix_bluetooth_init(void)
>
> --
> 2.42.0
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors
[not found] ` <20231001-pxa-gpio-v4-2-0f3b975e6ed5@skole.hr>
2023-10-01 14:34 ` [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs " Andy Shevchenko
@ 2023-10-02 8:54 ` Linus Walleij
1 sibling, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2023-10-02 8:54 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Bartosz Golaszewski,
Andy Shevchenko, Dmitry Torokhov, Mark Brown, linux-arm-kernel,
linux-kernel, linux-usb, linux-gpio, linux-input, linux-spi
On Sun, Oct 1, 2023 at 4:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
> Sharp's Spitz board still uses the legacy GPIO interface for configuring
> its two onboard LEDs.
>
> Convert them to use the GPIO descriptor interface.
>
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
LGTM:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver
[not found] ` <20231001-pxa-gpio-v4-6-0f3b975e6ed5@skole.hr>
2023-10-01 14:56 ` [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver Andy Shevchenko
@ 2023-10-02 8:59 ` Linus Walleij
2023-10-02 11:39 ` Mark Brown
2 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2023-10-02 8:59 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Bartosz Golaszewski,
Andy Shevchenko, Dmitry Torokhov, Mark Brown, linux-arm-kernel,
linux-kernel, linux-usb, linux-gpio, linux-input, linux-spi
On Sun, Oct 1, 2023 at 4:13 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
> If this code is left in the board file, the sync GPIO would have to be
> separated into another lookup table during conversion to the GPIO
> descriptor API (which is also done in this patch).
>
> The only user of this code (Sharp Spitz) is also converted in this
> patch.
>
> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Looking good!
With Andy's nits fixed:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver
[not found] ` <20231001-pxa-gpio-v4-6-0f3b975e6ed5@skole.hr>
2023-10-01 14:56 ` [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver Andy Shevchenko
2023-10-02 8:59 ` Linus Walleij
@ 2023-10-02 11:39 ` Mark Brown
2 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2023-10-02 11:39 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij,
Bartosz Golaszewski, Andy Shevchenko, Dmitry Torokhov,
linux-arm-kernel, linux-kernel, linux-usb, linux-gpio,
linux-input, linux-spi
[-- Attachment #1.1: Type: text/plain, Size: 308 bytes --]
On Sun, Oct 01, 2023 at 04:12:57PM +0200, Duje Mihanović wrote:
> If this code is left in the board file, the sync GPIO would have to be
> separated into another lookup table during conversion to the GPIO
> descriptor API (which is also done in this patch).
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 5/6] ARM: pxa: Convert gumstix Bluetooth to GPIO descriptors
2023-10-02 7:42 ` [PATCH RFC v4 5/6] ARM: pxa: Convert gumstix Bluetooth " Bartosz Golaszewski
@ 2023-10-02 14:52 ` Duje Mihanović
2023-10-02 17:09 ` Bartosz Golaszewski
0 siblings, 1 reply; 13+ messages in thread
From: Duje Mihanović @ 2023-10-02 14:52 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij, Andy Shevchenko,
Dmitry Torokhov, Mark Brown, linux-arm-kernel, linux-kernel,
linux-usb, linux-gpio, linux-input, linux-spi
On Monday, October 2, 2023 9:42:52 AM CEST Bartosz Golaszewski wrote:
> This changes the way this code works. You release the descriptor here,
> it returns to the driver and can be re-requested by someone else. Its
> value is also not guaranteed to remain as "active". Is this what you
> want?
Good point. Is it enough to not call gpiod_put() at the end or is it necessary
to use a static gpio_desc instead of a local one?
Regards,
Duje
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC v4 5/6] ARM: pxa: Convert gumstix Bluetooth to GPIO descriptors
2023-10-02 14:52 ` Duje Mihanović
@ 2023-10-02 17:09 ` Bartosz Golaszewski
0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2023-10-02 17:09 UTC (permalink / raw)
To: Duje Mihanović
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Russell King,
Alan Stern, Greg Kroah-Hartman, Linus Walleij, Andy Shevchenko,
Dmitry Torokhov, Mark Brown, linux-arm-kernel, linux-kernel,
linux-usb, linux-gpio, linux-input, linux-spi
On Mon, Oct 2, 2023 at 4:53 PM Duje Mihanović <duje.mihanovic@skole.hr> wrote:
>
> On Monday, October 2, 2023 9:42:52 AM CEST Bartosz Golaszewski wrote:
> > This changes the way this code works. You release the descriptor here,
> > it returns to the driver and can be re-requested by someone else. Its
> > value is also not guaranteed to remain as "active". Is this what you
> > want?
>
> Good point. Is it enough to not call gpiod_put() at the end or is it necessary
> to use a static gpio_desc instead of a local one?
>
Technically it's enough to not put it. It will live on but the
reference will be leaked and most likely this will be reported by
kmemleak. So static desc would make more sense.
Bart
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-10-02 17:10 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231001-pxa-gpio-v4-0-0f3b975e6ed5@skole.hr>
[not found] ` <20231001-pxa-gpio-v4-1-0f3b975e6ed5@skole.hr>
2023-10-01 14:32 ` [PATCH RFC v4 1/6] ARM: pxa: Convert Spitz OHCI to GPIO descriptors Andy Shevchenko
2023-10-01 18:39 ` Duje Mihanović
[not found] ` <20231001-pxa-gpio-v4-2-0f3b975e6ed5@skole.hr>
2023-10-01 14:34 ` [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs " Andy Shevchenko
2023-10-02 7:36 ` Bartosz Golaszewski
2023-10-02 8:54 ` Linus Walleij
[not found] ` <20231001-pxa-gpio-v4-4-0f3b975e6ed5@skole.hr>
2023-10-01 14:40 ` [PATCH RFC v4 4/6] ARM: pxa: Convert reset driver " Andy Shevchenko
2023-10-01 14:50 ` Andy Shevchenko
[not found] ` <20231001-pxa-gpio-v4-5-0f3b975e6ed5@skole.hr>
2023-10-02 7:42 ` [PATCH RFC v4 5/6] ARM: pxa: Convert gumstix Bluetooth " Bartosz Golaszewski
2023-10-02 14:52 ` Duje Mihanović
2023-10-02 17:09 ` Bartosz Golaszewski
[not found] ` <20231001-pxa-gpio-v4-6-0f3b975e6ed5@skole.hr>
2023-10-01 14:56 ` [PATCH RFC v4 6/6] input: ads7846: Move wait_for_sync() logic to driver Andy Shevchenko
2023-10-02 8:59 ` Linus Walleij
2023-10-02 11:39 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).