Skip to content

Commit dda8e14

Browse files
committed
gpio: sim: check the label length when setting up device properties
If the user-space sets the chip label to an empty string - we should check the length and not override the default name or else line hogs will not be properly attached. Fixes: cb8c474 ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent e783362 commit dda8e14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio-sim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ gpio_sim_make_bank_swnode(struct gpio_sim_bank *bank,
816816

817817
properties[prop_idx++] = PROPERTY_ENTRY_U32("ngpios", bank->num_lines);
818818

819-
if (bank->label)
819+
if (bank->label && (strlen(bank->label) > 0))
820820
properties[prop_idx++] = PROPERTY_ENTRY_STRING("gpio-sim,label",
821821
bank->label);
822822

0 commit comments

Comments
 (0)