summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-tegra.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-07-24 10:55:05 -0400
committerLinus Walleij <linus.walleij@linaro.org>2017-08-14 09:01:13 -0400
commit20133bd5ebbb58cdf224c769dea2a475c746bc1a (patch)
tree7f94fcd449aa03d611c6e3ff1ecee3aa29b7ea14 /drivers/gpio/gpio-tegra.c
parente3b445d77819b8fb41e3ceae9dbd49c8c8427c5d (diff)
gpio: tegra: Remove unnecessary check
of_device_get_match_data() can never return NULL, therefore the check for NULL values is unnecessary. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tegra.c')
-rw-r--r--drivers/gpio/gpio-tegra.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 755d3b61fbb7..c68455b7e26e 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -567,7 +567,6 @@ static struct lock_class_key gpio_lock_class;
567 567
568static int tegra_gpio_probe(struct platform_device *pdev) 568static int tegra_gpio_probe(struct platform_device *pdev)
569{ 569{
570 const struct tegra_gpio_soc_config *config;
571 struct tegra_gpio_info *tgi; 570 struct tegra_gpio_info *tgi;
572 struct resource *res; 571 struct resource *res;
573 struct tegra_gpio_bank *bank; 572 struct tegra_gpio_bank *bank;
@@ -576,17 +575,11 @@ static int tegra_gpio_probe(struct platform_device *pdev)
576 int i; 575 int i;
577 int j; 576 int j;
578 577
579 config = of_device_get_match_data(&pdev->dev);
580 if (!config) {
581 dev_err(&pdev->dev, "Error: No device match found\n");
582 return -ENODEV;
583 }
584
585 tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL); 578 tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL);
586 if (!tgi) 579 if (!tgi)
587 return -ENODEV; 580 return -ENODEV;
588 581
589 tgi->soc = config; 582 tgi->soc = of_device_get_match_data(&pdev->dev);
590 tgi->dev = &pdev->dev; 583 tgi->dev = &pdev->dev;
591 584
592 ret = platform_irq_count(pdev); 585 ret = platform_irq_count(pdev);
@@ -626,7 +619,7 @@ static int tegra_gpio_probe(struct platform_device *pdev)
626 619
627 platform_set_drvdata(pdev, tgi); 620 platform_set_drvdata(pdev, tgi);
628 621
629 if (config->debounce_supported) 622 if (tgi->soc->debounce_supported)
630 tgi->gc.set_config = tegra_gpio_set_config; 623 tgi->gc.set_config = tegra_gpio_set_config;
631 624
632 tgi->bank_info = devm_kzalloc(&pdev->dev, tgi->bank_count * 625 tgi->bank_info = devm_kzalloc(&pdev->dev, tgi->bank_count *