Commit 4827aae0 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 2e539b73
...@@ -377,8 +377,8 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev) ...@@ -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); ret = fwnode_property_read_string(swnode, "gpio-sim,label", &label);
if (ret) { if (ret) {
label = devm_kasprintf(dev, GFP_KERNEL, "%s-%s", label = devm_kasprintf(dev, GFP_KERNEL, "%s-%pfwP",
dev_name(dev), fwnode_get_name(swnode)); dev_name(dev), swnode);
if (!label) if (!label)
return -ENOMEM; return -ENOMEM;
} }
...@@ -784,10 +784,9 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev) ...@@ -784,10 +784,9 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev)
GFP_KERNEL); GFP_KERNEL);
else else
hog->chip_label = kasprintf(GFP_KERNEL, hog->chip_label = kasprintf(GFP_KERNEL,
"gpio-sim.%u-%s", "gpio-sim.%u-%pfwP",
dev->id, dev->id,
fwnode_get_name( bank->swnode);
bank->swnode));
if (!hog->chip_label) { if (!hog->chip_label) {
gpio_sim_remove_hogs(dev); gpio_sim_remove_hogs(dev);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment