mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-01 01:14:19 -04:00
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>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
aea92b54ee
commit
67f64d1589
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user