[PATCH v11.1 6/5] media: bcm2835-unicam: Return error code when DT parsing fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Three of the error paths in unicam_async_nf_init() when DT parsing fails
are not setting the ret variable, resulting in the function returning 0
on error. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
---
Changes since v11:

- Address a third error path
---
 drivers/media/platform/broadcom/bcm2835-unicam.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
index e91d02a64770..bd2bbb53070e 100644
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -2519,6 +2519,7 @@ static int unicam_async_nf_init(struct unicam_device *unicam)
 		    num_data_lanes != 4) {
 			dev_err(unicam->dev, "%u data lanes not supported\n",
 				num_data_lanes);
+			ret = -EINVAL;
 			goto error;
 		}
 
@@ -2526,6 +2527,7 @@ static int unicam_async_nf_init(struct unicam_device *unicam)
 			dev_err(unicam->dev,
 				"Endpoint uses %u data lanes when %u are supported\n",
 				num_data_lanes, unicam->max_data_lanes);
+			ret = -EINVAL;
 			goto error;
 		}
 
@@ -2542,6 +2544,7 @@ static int unicam_async_nf_init(struct unicam_device *unicam)
 	default:
 		/* Unsupported bus type */
 		dev_err(unicam->dev, "Unsupported bus type %u\n", ep.bus_type);
+		ret = -EINVAL;
 		goto error;
 	}
 

base-commit: ddf6839f6b00b8c8f5f460452476a894417db4f2
-- 
Regards,

Laurent Pinchart





[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux