Commit 20133bd5 authored by Thierry Reding's avatar Thierry Reding Committed by Linus Walleij

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: default avatarThierry Reding <treding@nvidia.com>
Acked-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e3b445d7
...@@ -567,7 +567,6 @@ static struct lock_class_key gpio_lock_class; ...@@ -567,7 +567,6 @@ static struct lock_class_key gpio_lock_class;
static int tegra_gpio_probe(struct platform_device *pdev) static int tegra_gpio_probe(struct platform_device *pdev)
{ {
const struct tegra_gpio_soc_config *config;
struct tegra_gpio_info *tgi; struct tegra_gpio_info *tgi;
struct resource *res; struct resource *res;
struct tegra_gpio_bank *bank; struct tegra_gpio_bank *bank;
...@@ -576,17 +575,11 @@ static int tegra_gpio_probe(struct platform_device *pdev) ...@@ -576,17 +575,11 @@ static int tegra_gpio_probe(struct platform_device *pdev)
int i; int i;
int j; int j;
config = of_device_get_match_data(&pdev->dev);
if (!config) {
dev_err(&pdev->dev, "Error: No device match found\n");
return -ENODEV;
}
tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL); tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL);
if (!tgi) if (!tgi)
return -ENODEV; return -ENODEV;
tgi->soc = config; tgi->soc = of_device_get_match_data(&pdev->dev);
tgi->dev = &pdev->dev; tgi->dev = &pdev->dev;
ret = platform_irq_count(pdev); ret = platform_irq_count(pdev);
...@@ -626,7 +619,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) ...@@ -626,7 +619,7 @@ static int tegra_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, tgi); platform_set_drvdata(pdev, tgi);
if (config->debounce_supported) if (tgi->soc->debounce_supported)
tgi->gc.set_config = tegra_gpio_set_config; tgi->gc.set_config = tegra_gpio_set_config;
tgi->bank_info = devm_kzalloc(&pdev->dev, tgi->bank_count * tgi->bank_info = devm_kzalloc(&pdev->dev, tgi->bank_count *
......
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