diff options
Diffstat (limited to 'drivers/gpio/gpio-pl061.c')
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 04756130437f..400927109531 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -272,8 +272,11 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) if (of_property_read_bool(dev->of_node, "gpio-ranges")) chip->uses_pinctrl = true; - chip->gc.request = pl061_gpio_request; - chip->gc.free = pl061_gpio_free; + /* Hook the request()/free() for pinctrl operation */ + if (of_get_property(dev->of_node, "gpio-ranges", NULL)) { + chip->gc.request = pl061_gpio_request; + chip->gc.free = pl061_gpio_free; + } chip->gc.direction_input = pl061_direction_input; chip->gc.direction_output = pl061_direction_output; chip->gc.get = pl061_get_value; |