]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: sim: fix hogs with custom chip labels
authorBartosz Golaszewski <brgl@bgdev.pl>
Tue, 8 Feb 2022 10:37:56 +0000 (11:37 +0100)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 9 Feb 2022 10:41:29 +0000 (11:41 +0100)
commit1865a49938caf1f81e5977cd96bc3b0ab5eeba2c
tree1d588a80abdc394a780fbe510d1d0d2ee9bcfd0c
parent4d69a4b6652e1f32aee97854446ce1a184942c3d
gpio: sim: fix hogs with custom chip labels

We always assign the default device name as the chip_label in hog
structures which makes it impossible to assign hogs to chips. Let's
first check if a custom label was set and then copy it instead of the
default device name.

Fixes: eee5b4460bf3 ("gpio: sim: new testing module")
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
drivers/gpio/gpio-sim.c