summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-04-30 10:38:15 +0300
committerLinus Walleij <linus.walleij@linaro.org>2018-05-16 15:35:24 +0300
commit8357759a4201f3b165b3240095268ebc63493cc2 (patch)
tree5b33fdbdca2f4862831816926aaaafad3a46e7a4 /drivers
parent67bab9353391f65a497442b1f9f920d452790c5a (diff)
downloadlinux-8357759a4201f3b165b3240095268ebc63493cc2.tar.xz
gpio: pxa: 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')
-rw-r--r--drivers/gpio/gpio-pxa.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index f480fb896963..3c1f65bc0fa8 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -579,15 +579,9 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev,
struct pxa_gpio_chip *pchip)
{
int nr_gpios;
- const struct of_device_id *of_id =
- of_match_device(pxa_gpio_dt_ids, &pdev->dev);
const struct pxa_gpio_id *gpio_id;
- if (!of_id || !of_id->data) {
- dev_err(&pdev->dev, "Failed to find gpio controller\n");
- return -EFAULT;
- }
- gpio_id = of_id->data;
+ gpio_id = of_device_get_match_data(&pdev->dev);
gpio_type = gpio_id->type;
nr_gpios = gpio_id->gpio_nums;