From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpio: sim: check the label length when setting up device properties
Date: Fri, 21 Jan 2022 06:18:12 +0800 [thread overview]
Message-ID: <20220120221812.GA8128@sol> (raw)
In-Reply-To: <20220120194948.1138813-1-brgl@bgdev.pl>
On Thu, Jan 20, 2022 at 08:49:48PM +0100, Bartosz Golaszewski wrote:
> If the user-space sets the chip label to an empty string - we should
> check the length and assign the default name or otherwise line hogs
> will not be properly attached.
>
"assign" -> "not override"?
Cheers,
Kent.
> Fixes: cb8c474e79be ("gpio: sim: new testing module")
> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
> drivers/gpio/gpio-sim.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index 838bbfed11d3..04b137eca8da 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -816,7 +816,7 @@ gpio_sim_make_bank_swnode(struct gpio_sim_bank *bank,
>
> properties[prop_idx++] = PROPERTY_ENTRY_U32("ngpios", bank->num_lines);
>
> - if (bank->label)
> + if (bank->label && (strlen(bank->label) > 0))
> properties[prop_idx++] = PROPERTY_ENTRY_STRING("gpio-sim,label",
> bank->label);
>
> --
> 2.30.1
>
next prev parent reply other threads:[~2022-01-20 22:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 19:49 [PATCH] gpio: sim: check the label length when setting up device properties Bartosz Golaszewski
2022-01-20 22:18 ` Kent Gibson [this message]
2022-01-24 8:20 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220120221812.GA8128@sol \
--to=warthog618@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).