diff mbox series

[v1] drm/tegra: Fix gpiod_get_from_of_node() regression

Message ID 20190705151139.19032-1-digetx@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v1] drm/tegra: Fix gpiod_get_from_of_node() regression | expand

Commit Message

Dmitry Osipenko July 5, 2019, 3:11 p.m. UTC
That function now returns ERR_PTR instead of NULL if "hpd-gpio" is not
present in device-tree. The offending patch missed to adapt the Tegra's
DRM driver for the API change.

Fixes: 025bf37725f1 ("gpio: Fix return value mismatch of function gpiod_get_from_of_node()")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/gpu/drm/tegra/output.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jon Hunter July 9, 2019, 4:27 p.m. UTC | #1
On 05/07/2019 16:11, Dmitry Osipenko wrote:
> That function now returns ERR_PTR instead of NULL if "hpd-gpio" is not
> present in device-tree. The offending patch missed to adapt the Tegra's
> DRM driver for the API change.
> 
> Fixes: 025bf37725f1 ("gpio: Fix return value mismatch of function gpiod_get_from_of_node()")
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/gpu/drm/tegra/output.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
> index 274cb955e2e1..471d33809cd4 100644
> --- a/drivers/gpu/drm/tegra/output.c
> +++ b/drivers/gpu/drm/tegra/output.c
> @@ -126,8 +126,12 @@ int tegra_output_probe(struct tegra_output *output)
>  						       "nvidia,hpd-gpio", 0,
>  						       GPIOD_IN,
>  						       "HDMI hotplug detect");
> -	if (IS_ERR(output->hpd_gpio))
> -		return PTR_ERR(output->hpd_gpio);
> +	if (IS_ERR(output->hpd_gpio)) {
> +		if (PTR_ERR(output->hpd_gpio) == -ENOENT)
> +			output->hpd_gpio = NULL;
> +		else
> +			return PTR_ERR(output->hpd_gpio);
> +	}
>  
>  	if (output->hpd_gpio) {
>  		err = gpiod_to_irq(output->hpd_gpio);
> 

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
Dmitry Osipenko July 9, 2019, 9:04 p.m. UTC | #2
09.07.2019 19:27, Jon Hunter пишет:
> 
> On 05/07/2019 16:11, Dmitry Osipenko wrote:
>> That function now returns ERR_PTR instead of NULL if "hpd-gpio" is not
>> present in device-tree. The offending patch missed to adapt the Tegra's
>> DRM driver for the API change.
>>
>> Fixes: 025bf37725f1 ("gpio: Fix return value mismatch of function gpiod_get_from_of_node()")
>> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
>> ---
>>  drivers/gpu/drm/tegra/output.c | 8 ++++++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
>> index 274cb955e2e1..471d33809cd4 100644
>> --- a/drivers/gpu/drm/tegra/output.c
>> +++ b/drivers/gpu/drm/tegra/output.c
>> @@ -126,8 +126,12 @@ int tegra_output_probe(struct tegra_output *output)
>>  						       "nvidia,hpd-gpio", 0,
>>  						       GPIOD_IN,
>>  						       "HDMI hotplug detect");
>> -	if (IS_ERR(output->hpd_gpio))
>> -		return PTR_ERR(output->hpd_gpio);
>> +	if (IS_ERR(output->hpd_gpio)) {
>> +		if (PTR_ERR(output->hpd_gpio) == -ENOENT)
>> +			output->hpd_gpio = NULL;
>> +		else
>> +			return PTR_ERR(output->hpd_gpio);
>> +	}
>>  
>>  	if (output->hpd_gpio) {
>>  		err = gpiod_to_irq(output->hpd_gpio);
>>
> 
> Acked-by: Jon Hunter <jonathanh@nvidia.com>

Thanks!
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c
index 274cb955e2e1..471d33809cd4 100644
--- a/drivers/gpu/drm/tegra/output.c
+++ b/drivers/gpu/drm/tegra/output.c
@@ -126,8 +126,12 @@  int tegra_output_probe(struct tegra_output *output)
 						       "nvidia,hpd-gpio", 0,
 						       GPIOD_IN,
 						       "HDMI hotplug detect");
-	if (IS_ERR(output->hpd_gpio))
-		return PTR_ERR(output->hpd_gpio);
+	if (IS_ERR(output->hpd_gpio)) {
+		if (PTR_ERR(output->hpd_gpio) == -ENOENT)
+			output->hpd_gpio = NULL;
+		else
+			return PTR_ERR(output->hpd_gpio);
+	}
 
 	if (output->hpd_gpio) {
 		err = gpiod_to_irq(output->hpd_gpio);