[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWUrHbizyKoLs-DJL43QvmE+Y=vCuGc+1yteYXYQOmURg@mail.gmail.com>
Date: Wed, 12 Feb 2025 15:20:06 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Koichiro Den <koichiro.den@...onical.com>
Cc: linux-gpio@...r.kernel.org, brgl@...ev.pl, linus.walleij@...aro.org,
maciej.borzecki@...onical.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 03/10] gpio: aggregator: add read-only 'dev_name'
configfs attribute
Hi Den-san,
On Mon, 3 Feb 2025 at 04:12, Koichiro Den <koichiro.den@...onical.com> wrote:
> Add a read-only 'dev_name' attribute to configfs interface, which
> exposes the platform bus device name. Users can easily identify which
> gpiochip<N> has been created as follows:
>
> $ cat /sys/kernel/config/gpio-aggregator/<aggregator-name>/dev_name
> gpio-aggregator.0
> $ ls -d /sys/devices/platform/gpio-aggregator.0/gpiochip*
> gpiochip3
>
> Signed-off-by: Koichiro Den <koichiro.den@...onical.com>
Thanks for your patch!
> --- a/drivers/gpio/gpio-aggregator.c
> +++ b/drivers/gpio/gpio-aggregator.c
> @@ -732,6 +732,23 @@ static struct configfs_attribute *gpio_aggr_line_attrs[] = {
> NULL
> };
>
> +static ssize_t
> +gpio_aggr_device_dev_name_show(struct config_item *item, char *page)
> +{
> + struct gpio_aggregator *aggr = to_gpio_aggregator(item);
> + struct platform_device *pdev;
> +
> + guard(mutex)(&aggr->lock);
> +
> + pdev = aggr->pdev;
> + if (pdev)
> + return sprintf(page, "%s\n", dev_name(&pdev->dev));
> +
> + return sprintf(page, "%s.%d\n", DRV_NAME, aggr->id);
sysfs_emit(), for both branches.
> +}
> +
Please drop this blank line (everywhere).
> +CONFIGFS_ATTR_RO(gpio_aggr_device_, dev_name);
> +
> static ssize_t
> gpio_aggr_device_live_show(struct config_item *item, char *page)
> {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists