devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Zink <j.zink@pengutronix.de>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Dan Carpenter <error27@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	devicetree@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Rob Herring <robh+dt@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	patchwork-jzi@pengutronix.de, David Airlie <airlied@gmail.com>,
	kernel@pengutronix.de, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v3 3/3] drm/panel-simple: allow LVDS format override
Date: Fri, 28 Jul 2023 14:21:19 +0200	[thread overview]
Message-ID: <f511c66b-10b3-0af1-3bb5-801060c3a55e@pengutronix.de> (raw)
In-Reply-To: <1cd00596-604d-4fbf-b9d1-9ee0f05cb373@kadam.mountain>

Hi Dan,

thanks for your feedback.

On 7/28/23 14:03, Dan Carpenter wrote:
> On Fri, Jul 28, 2023 at 01:54:40PM +0200, Johannes Zink wrote:
>> @@ -556,7 +602,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>>   	struct device_node *ddc;
>>   	int connector_type;
>>   	u32 bus_flags;
>> -	int err;
>> +	int err, ret;
> 
> I don't like this at all...
> 
>>   
>>   	panel = devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL);
>>   	if (!panel)
>> @@ -601,6 +647,13 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>>   			panel_simple_parse_panel_timing_node(dev, panel, &dt);
>>   	}
>>   
>> +	if (desc->connector_type == DRM_MODE_CONNECTOR_LVDS) {
>> +		/* Optional data-mapping property for overriding bus format */
>> +		ret = panel_simple_override_nondefault_lvds_datamapping(dev, panel);
>> +		if (ret)
>> +			goto free_ddc;
> 
> This *looks* like we are returning an error but we aren't.  I think we
> should be.  If not then we need to have a discussion about that and
> add some comments.
> 

Good catch. This should actually be err instead of ret. This way we'd make sure
to return -ENOMEM from panel_simple_probe() in case an error occured due
to devm_kmemdup failing in panel_simple_override_nondefault_lvds_datamapping().

I'll send a v4 with that fixed.

Thanks for having my back!
Johannes

> regards,
> dan carpenter
> 
>> +	}
>> +
>>   	connector_type = desc->connector_type;
>>   	/* Catch common mistakes for panels. */
>>   	switch (connector_type) {
>>
>> -- 
>> 2.39.2
> 
> 

-- 
Pengutronix e.K.                | Johannes Zink                  |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |


      reply	other threads:[~2023-07-28 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 11:54 [PATCH v3 0/3] Support non-default LVDS data mapping for simple panel Johannes Zink
2023-07-28 11:54 ` [PATCH v3 1/3] dt-bindings: display: move LVDS data-mapping definition to separate file Johannes Zink
2023-07-28 11:54 ` [PATCH v3 2/3] dt-bindings: display: simple: support non-default data-mapping Johannes Zink
2023-07-28 11:54 ` [PATCH v3 3/3] drm/panel-simple: allow LVDS format override Johannes Zink
2023-07-28 12:03   ` Dan Carpenter
2023-07-28 12:21     ` Johannes Zink [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=f511c66b-10b3-0af1-3bb5-801060c3a55e@pengutronix.de \
    --to=j.zink@pengutronix.de \
    --cc=airlied@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=neil.armstrong@linaro.org \
    --cc=patchwork-jzi@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).