Commit dda8e143 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

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: cb8c474e ("gpio: sim: new testing module")
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent e783362e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@ gpio_sim_make_bank_swnode(struct gpio_sim_bank *bank,

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

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