diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-03-07 21:25:55 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-03-08 13:50:07 +0300 |
commit | 67f64d1589ba946970aaaed35ee6335d043a4933 (patch) | |
tree | 09246d3b5f1a8fc5123dfce7d0579b8982d7d21e /drivers/gpio/gpiolib.c | |
parent | aea92b54ee7efac582dcad0d233f2c97d93147d8 (diff) | |
download | linux-67f64d1589ba946970aaaed35ee6335d043a4933.tar.xz |
gpiolib: Access device's fwnode via dev_fwnode()
GPIO device's fwnode should be accessed via dev_fwnode().
Make sure that gpiochip_setup_dev() follows that.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 700195a1faae..b1aa13d1b7e3 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -588,14 +588,15 @@ static void gpiodevice_release(struct device *dev) static int gpiochip_setup_dev(struct gpio_device *gdev) { + struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev); int ret; /* * If fwnode doesn't belong to another device, it's safe to clear its * initialized flag. */ - if (gdev->dev.fwnode && !gdev->dev.fwnode->dev) - fwnode_dev_initialized(gdev->dev.fwnode, false); + if (fwnode && !fwnode->dev) + fwnode_dev_initialized(fwnode, false); ret = gcdev_register(gdev, gpio_devt); if (ret) |