Commit a0cac264 authored by Linus Walleij's avatar Linus Walleij Committed by Wolfram Sang

i2c: pca-platform: Fix GPIO lookup code

The devm_gpiod_request_gpiod() call will add "-gpios" to
any passed connection ID before looking it up.

I do not think the reset GPIO on this platform is named
"reset-gpios-gpios" but rather "reset-gpios" in the device
tree, so fix this up so that we get a proper reset GPIO
handle.

Also drop the inclusion of the legacy GPIO header.

Fixes: 0e8ce93b ("i2c: pca-platform: add devicetree awareness")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent ca21f851
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/i2c-algo-pca.h> #include <linux/i2c-algo-pca.h>
#include <linux/platform_data/i2c-pca-platform.h> #include <linux/platform_data/i2c-pca-platform.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h> #include <linux/of.h>
...@@ -173,7 +172,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) ...@@ -173,7 +172,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
i2c->adap.dev.parent = &pdev->dev; i2c->adap.dev.parent = &pdev->dev;
i2c->adap.dev.of_node = np; i2c->adap.dev.of_node = np;
i2c->gpio = devm_gpiod_get_optional(&pdev->dev, "reset-gpios", GPIOD_OUT_LOW); i2c->gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(i2c->gpio)) if (IS_ERR(i2c->gpio))
return PTR_ERR(i2c->gpio); return PTR_ERR(i2c->gpio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment