Message ID | CAPgLHd8W+vo9FD7tAT3eBM_-akXStB8ib93xTk6oS8+5TTYNAQ@mail.gmail.com |
---|---|
State | Not Applicable, archived |
Headers | show |
On 12/13/2013 10:15 PM, Wei Yongjun wrote: > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> > > Fix to return -ENODEV instead of 0 when no GPIO supplied in > tegra20_ac97_platform_probe(). > diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c > @@ -358,6 +358,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) > } > } else { > dev_err(&pdev->dev, "no codec-reset GPIO supplied\n"); > + ret = -ENODEV; This would be better as: ret = ac97->reset_gpio; Since that will propagate the exact error code (and incidentally, deferred probe will work correctly then). > if (!gpio_is_valid(ac97->sync_gpio)) { > dev_err(&pdev->dev, "no codec-sync GPIO supplied\n"); > + ret = -ENODEV; Similarly here, ret = ac97->sync_gpio; -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index d8b98d7..3ea9738 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -358,6 +358,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) } } else { dev_err(&pdev->dev, "no codec-reset GPIO supplied\n"); + ret = -ENODEV; goto err_clk_put; } @@ -365,6 +366,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) "nvidia,codec-sync-gpio", 0); if (!gpio_is_valid(ac97->sync_gpio)) { dev_err(&pdev->dev, "no codec-sync GPIO supplied\n"); + ret = -ENODEV; goto err_clk_put; }