Commit graph

3 commits

Author SHA1 Message Date
Yang Yingliang
a2d05fb734 gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe()
Calling fwnode_handle_put() when break out of device_for_each_child_node(),
or the device node reference will be leakd.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-21 16:19:14 +01:00
Tom Rix
c08995bff2 gpio: sim: fix uninitialized ret variable
Building with clang returns this error:

gpio-sim.c:889:7: error: variable 'ret' is uninitialized
  when used here

ret should be the status of the call to
gpio_sim_make_bank_swnode stored in bank->swnode.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2021-12-19 14:47:30 +01:00
Bartosz Golaszewski
cb8c474e79 gpio: sim: new testing module
Implement a new, modern GPIO testing module controlled by configfs
attributes instead of module parameters. The goal of this driver is
to provide a replacement for gpio-mockup that will be easily extensible
with new features and doesn't require reloading the module to change
the setup.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
2021-12-17 12:26:13 +01:00