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)
commitc162ca0bcbfb39308c4dff4157e27c751af7032a
tree1d588a80abdc394a780fbe510d1d0d2ee9bcfd0c
parentcc38ef936840ac29204d806deb4d1836ec509594
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: cb8c474e79be ("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