mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02: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:
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user