drm/tegra: return with probe defer if GPIO subsystem is not ready
diff mbox series

Message ID 20180726133606.14587-1-stefan@agner.ch
State New
Headers show
Series
  • drm/tegra: return with probe defer if GPIO subsystem is not ready
Related show

Commit Message

Stefan Agner July 26, 2018, 1:36 p.m. UTC
If the GPIO subsystem is not ready make sure to return -EPROBE_DEFER
instead of silently continuing without HPD.

Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/tegra/output.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Agner Sept. 6, 2018, 11:31 p.m. UTC | #1
On 26.07.2018 06:36, Stefan Agner wrote:
> If the GPIO subsystem is not ready make sure to return -EPROBE_DEFER
> instead of silently continuing without HPD.
> 
> Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

I think this did not get merged yet, any chance to get it in?

--
Stefan

> ---
>  drivers/gpu/drm/tegra/output.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
> index ffe34bd0bb9d..4bcefe455afd 100644
> --- a/drivers/gpu/drm/tegra/output.c
> +++ b/drivers/gpu/drm/tegra/output.c
> @@ -133,7 +133,9 @@ int tegra_output_probe(struct tegra_output *output)
>  	output->hpd_gpio = of_get_named_gpio_flags(output->of_node,
>  						   "nvidia,hpd-gpio", 0,
>  						   &output->hpd_gpio_flags);
> -	if (gpio_is_valid(output->hpd_gpio)) {
> +	if (output->hpd_gpio == -EPROBE_DEFER) {
> +		return -EPROBE_DEFER;
> +	} else if (gpio_is_valid(output->hpd_gpio)) {
>  		unsigned long flags;
>  
>  		err = gpio_request_one(output->hpd_gpio, GPIOF_DIR_IN,

Patch
diff mbox series

diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
index ffe34bd0bb9d..4bcefe455afd 100644
--- a/drivers/gpu/drm/tegra/output.c
+++ b/drivers/gpu/drm/tegra/output.c
@@ -133,7 +133,9 @@  int tegra_output_probe(struct tegra_output *output)
 	output->hpd_gpio = of_get_named_gpio_flags(output->of_node,
 						   "nvidia,hpd-gpio", 0,
 						   &output->hpd_gpio_flags);
-	if (gpio_is_valid(output->hpd_gpio)) {
+	if (output->hpd_gpio == -EPROBE_DEFER) {
+		return -EPROBE_DEFER;
+	} else if (gpio_is_valid(output->hpd_gpio)) {
 		unsigned long flags;
 
 		err = gpio_request_one(output->hpd_gpio, GPIOF_DIR_IN,