Skip to content

Commit 4827aae

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
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 <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 2e539b7 commit 4827aae

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/gpio/gpio-sim.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,8 @@ static int gpio_sim_add_bank(struct fwnode_handle *swnode, struct device *dev)
377377

378378
ret = fwnode_property_read_string(swnode, "gpio-sim,label", &label);
379379
if (ret) {
380-
label = devm_kasprintf(dev, GFP_KERNEL, "%s-%s",
381-
dev_name(dev), fwnode_get_name(swnode));
380+
label = devm_kasprintf(dev, GFP_KERNEL, "%s-%pfwP",
381+
dev_name(dev), swnode);
382382
if (!label)
383383
return -ENOMEM;
384384
}
@@ -784,10 +784,9 @@ static int gpio_sim_add_hogs(struct gpio_sim_device *dev)
784784
GFP_KERNEL);
785785
else
786786
hog->chip_label = kasprintf(GFP_KERNEL,
787-
"gpio-sim.%u-%s",
787+
"gpio-sim.%u-%pfwP",
788788
dev->id,
789-
fwnode_get_name(
790-
bank->swnode));
789+
bank->swnode);
791790
if (!hog->chip_label) {
792791
gpio_sim_remove_hogs(dev);
793792
return -ENOMEM;

0 commit comments

Comments
 (0)