Skip to content

Commit

Permalink
gpio: sim: Use %pfwP specifier instead of calling fwnode API directly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andy-shev authored and Bartosz Golaszewski committed Feb 13, 2023
1 parent 2e539b7 commit 4827aae
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/gpio/gpio-sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4827aae

Please sign in to comment.