diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-02-12 17:13:55 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-02-13 16:48:35 +0300 |
commit | 4827aae061337251bb91801b316157a78b845ec7 (patch) | |
tree | ab3ff067bf18a53254af7761393848bfb8206372 /drivers/gpio/gpio-sim.c | |
parent | 2e539b735d8683097846b486c0fb093da5f27fbb (diff) | |
download | linux-4827aae061337251bb91801b316157a78b845ec7.tar.xz |
gpio: sim: Use %pfwP specifier instead of calling fwnode API directly
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@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-sim.c')
-rw-r--r-- | drivers/gpio/gpio-sim.c | 9 |
1 files 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; |