diff mbox series

media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor()

Message ID 20211013075319.GA6010@kili (mailing list archive)
State New, archived
Headers show
Series media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor() | expand

Commit Message

Dan Carpenter Oct. 13, 2021, 7:53 a.m. UTC
Return -ENODEV if acpi_get_physical_device_location() fails.  Don't
return success.

Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Daniel Scally Oct. 13, 2021, 10:41 p.m. UTC | #1
Hi Dan

On 13/10/2021 08:53, Dan Carpenter wrote:
> Return -ENODEV if acpi_get_physical_device_location() fails.  Don't
> return success.
>
> Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>


Thanks for catching that.


Reviewed-by: Daniel Scally <djrscally@gmail.com>

> ---
>  drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> index 67c467d3c81f..0b586b4e537e 100644
> --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c
> +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> @@ -238,8 +238,10 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
>  			goto err_put_adev;
>  
>  		status = acpi_get_physical_device_location(adev->handle, &sensor->pld);
> -		if (ACPI_FAILURE(status))
> +		if (ACPI_FAILURE(status)) {
> +			ret = -ENODEV;
>  			goto err_put_adev;
> +		}
>  
>  		if (sensor->ssdb.lanes > CIO2_MAX_LANES) {
>  			dev_err(&adev->dev,
Kieran Bingham Oct. 14, 2021, 11:45 a.m. UTC | #2
Quoting Dan Carpenter (2021-10-13 08:53:19)
> Return -ENODEV if acpi_get_physical_device_location() fails.  Don't
> return success.
> 
> Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/pci/intel/ipu3/cio2-bridge.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> index 67c467d3c81f..0b586b4e537e 100644
> --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c
> +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c
> @@ -238,8 +238,10 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
>                         goto err_put_adev;
>  
>                 status = acpi_get_physical_device_location(adev->handle, &sensor->pld);
> -               if (ACPI_FAILURE(status))
> +               if (ACPI_FAILURE(status)) {
> +                       ret = -ENODEV;
>                         goto err_put_adev;
> +               }
>  
>                 if (sensor->ssdb.lanes > CIO2_MAX_LANES) {
>                         dev_err(&adev->dev,
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c
index 67c467d3c81f..0b586b4e537e 100644
--- a/drivers/media/pci/intel/ipu3/cio2-bridge.c
+++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c
@@ -238,8 +238,10 @@  static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
 			goto err_put_adev;
 
 		status = acpi_get_physical_device_location(adev->handle, &sensor->pld);
-		if (ACPI_FAILURE(status))
+		if (ACPI_FAILURE(status)) {
+			ret = -ENODEV;
 			goto err_put_adev;
+		}
 
 		if (sensor->ssdb.lanes > CIO2_MAX_LANES) {
 			dev_err(&adev->dev,