All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Dave Stevenson <dave.stevenson@raspberrypi.com>,
	David Plowman <david.plowman@raspberrypi.com>,
	Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Naushir Patuck <naush@raspberrypi.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	kernel-list@raspberrypi.com,
	linux-rpi-kernel@lists.infradead.org,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Conor Dooley <conor+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: [PATCH v11.1 6/5] media: bcm2835-unicam: Return error code when DT parsing fails
Date: Sun, 28 Apr 2024 00:25:09 +0300	[thread overview]
Message-ID: <20240427212509.20750-1-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20240426133432.13266-1-laurent.pinchart@ideasonboard.com>

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@ideasonboard.com>
---
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


      reply	other threads:[~2024-04-27 21:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-24 15:35 [PATCH v11 0/5] media: Add driver for the Raspberry Pi <5 CSI-2 receiver Laurent Pinchart
2024-04-24 15:35 ` [PATCH v11 1/5] media: v4l: Add V4L2-PIX-FMT-Y12P format Laurent Pinchart
2024-04-24 15:35 ` [PATCH v11 2/5] media: v4l: Add V4L2-PIX-FMT-Y14P format Laurent Pinchart
2024-04-24 15:35 ` [PATCH v11 3/5] dt-bindings: media: Add bindings for bcm2835-unicam Laurent Pinchart
2024-04-24 15:35 ` [PATCH v11 4/5] media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface Laurent Pinchart
2024-04-24 15:35 ` [PATCH v11 5/5] ARM: dts: bcm2835: Add Unicam CSI nodes Laurent Pinchart
2024-04-24 16:53   ` Florian Fainelli
2024-04-24 16:28 ` [PATCH v11 0/5] media: Add driver for the Raspberry Pi <5 CSI-2 receiver Florian Fainelli
2024-04-24 16:33   ` Laurent Pinchart
2024-04-24 18:38     ` Sakari Ailus
2024-04-26 13:34 ` [PATCH v11 6/5] media: bcm2835-unicam: Return error code when DT parsing fails Laurent Pinchart
2024-04-27 21:25   ` Laurent Pinchart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240427212509.20750-1-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=david.plowman@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jeanmichel.hautbois@yoseli.org \
    --cc=kernel-list@raspberrypi.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=naush@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sbranden@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.