[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=McDPZMs+YTWbiFiG=WzkmrOKZmhSBfTyc7WwviX_ci+Cw@mail.gmail.com>
Date: Mon, 13 Feb 2023 14:49:44 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v1 1/1] gpio: sim: Use %pfwP specifier instead of calling
fwnode API directly
On Sun, Feb 12, 2023 at 3:14 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Instead of calling fwnode_get_name() and supply as %s, use %pfwP which
> will do the same inside printf() call.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/gpio/gpio-sim.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index 60514bc5454f..a51b5ea38ad5 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -377,8 +377,8 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
>
> ret = fwnode_property_read_string(swnode, "gpio-sim,label", &label);
> if (ret) {
> - label = devm_kasprintf(dev, GFP_KERNEL, "%s-%s",
> - dev_name(dev), fwnode_get_name(swnode));
> + label = devm_kasprintf(dev, GFP_KERNEL, "%s-%pfwP",
> + dev_name(dev), swnode);
> if (!label)
> return -ENOMEM;
> }
> @@ -784,10 +784,9 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev)
> GFP_KERNEL);
> else
> hog->chip_label = kasprintf(GFP_KERNEL,
> - "gpio-sim.%u-%s",
> + "gpio-sim.%u-%pfwP",
> dev->id,
> - fwnode_get_name(
> - bank->swnode));
> + bank->swnode);
> if (!hog->chip_label) {
> gpio_sim_remove_hogs(dev);
> return -ENOMEM;
> --
> 2.39.1
>
Applied, thanks!
Bart
Powered by blists - more mailing lists