aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-ts4900.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-04-30 09:38:17 +0200
committerLinus Walleij <linus.walleij@linaro.org>2018-05-16 14:35:24 +0200
commit81317c5a08a32a3798f56e4f40bbb8a3efd81271 (patch)
tree6e9a7446716540ff59842c4e11beca49f7a24819 /drivers/gpio/gpio-ts4900.c
parentgpio: syscon: Use of_device_get_match_data() (diff)
downloadlinux-dev-81317c5a08a32a3798f56e4f40bbb8a3efd81271.tar.xz
linux-dev-81317c5a08a32a3798f56e4f40bbb8a3efd81271.zip
gpio: ts4900: Use of_device_get_match_data()
Use of_device_get_match_data() instead of open-coding it. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-ts4900.c')
-rw-r--r--drivers/gpio/gpio-ts4900.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-ts4900.c b/drivers/gpio/gpio-ts4900.c
index 5bd21725e604..1da8d0586329 100644
--- a/drivers/gpio/gpio-ts4900.c
+++ b/drivers/gpio/gpio-ts4900.c
@@ -128,15 +128,10 @@ MODULE_DEVICE_TABLE(of, ts4900_gpio_of_match_table);
static int ts4900_gpio_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- const struct of_device_id *match;
struct ts4900_gpio_priv *priv;
u32 ngpio;
int ret;
- match = of_match_device(ts4900_gpio_of_match_table, &client->dev);
- if (!match)
- return -EINVAL;
-
if (of_property_read_u32(client->dev.of_node, "ngpios", &ngpio))
ngpio = DEFAULT_PIN_NUMBER;
@@ -148,7 +143,7 @@ static int ts4900_gpio_probe(struct i2c_client *client,
priv->gpio_chip.label = "ts4900-gpio";
priv->gpio_chip.ngpio = ngpio;
priv->gpio_chip.parent = &client->dev;
- priv->input_bit = (uintptr_t)match->data;
+ priv->input_bit = (uintptr_t)of_device_get_match_data(&client->dev);
priv->regmap = devm_regmap_init_i2c(client, &ts4900_regmap_config);
if (IS_ERR(priv->regmap)) {