diff options
author | Thierry Reding <treding@nvidia.com> | 2018-04-30 09:38:14 +0200 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2018-08-09 17:19:44 +0200 |
commit | 9686bb57f6cfe01effb153fa0b6dd0dc706b824a (patch) | |
tree | ab65a2a23ce75bddd55433b0884a5f203d627f88 | |
parent | 6b3c2add3fd1e3ff2bdd5099a4b37fd98c9f3f07 (diff) | |
download | renesas-backport-9686bb57f6cfe01effb153fa0b6dd0dc706b824a.tar.gz |
gpio: pca953x: 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>
(cherry picked from commit 67bab9353391f65a497442b1f9f920d452790c5a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | drivers/gpio/gpio-pca953x.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index c8bfd4acb40d0..6d202acf853e0 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -810,13 +810,11 @@ static int pca953x_probe(struct i2c_client *client, chip->driver_data = i2c_id->driver_data; } else { const struct acpi_device_id *acpi_id; - const struct of_device_id *match; + struct device *dev = &client->dev; - match = of_match_device(pca953x_dt_ids, &client->dev); - if (match) { - chip->driver_data = (int)(uintptr_t)match->data; - } else { - acpi_id = acpi_match_device(pca953x_acpi_ids, &client->dev); + chip->driver_data = (uintptr_t)of_device_get_match_data(dev); + if (!chip->driver_data) { + acpi_id = acpi_match_device(pca953x_acpi_ids, dev); if (!acpi_id) { ret = -ENODEV; goto err_exit; |