linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Luca Weiss <luca@z3ntu.xyz>
Cc: linux-leds@vger.kernel.org, Dan Murphy <dmurphy@ti.com>,
	Heiko Stuebner <heiko@sntech.de>, Icenowy Zheng <icenowy@aosc.io>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Maxime Ripard <mripard@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v3 2/2] leds: add sgm3140 driver
Date: Mon, 27 Apr 2020 11:51:02 +0200	[thread overview]
Message-ID: <20200427095102.GA21572@duo.ucw.cz> (raw)
In-Reply-To: <20200421191354.1443017-3-luca@z3ntu.xyz>

[-- Attachment #1: Type: text/plain, Size: 1462 bytes --]

Hi!

> Add a driver for the SGMICRO SGM3140 Buck/Boost Charge Pump LED driver.
> 
> This device is controlled by two GPIO pins, one for enabling and the
> second one for switching between torch and flash mode.
> 
> Signed-off-by: Luca Weiss <luca@z3ntu.xyz>

Thanks, applied, but... I may remove it again.

> +++ b/drivers/leds/leds-sgm3140.c
> @@ -0,0 +1,320 @@
> +// SPDX-License-Identifier: GPL-2.0

Would you consider GPL-2+?

> +#if IS_ENABLED(CONFIG_V4L2_FLASH_LED_CLASS)
> +static void sgm3140_init_v4l2_flash_config(struct sgm3140 *priv,

Ok.

> +static int sgm3140_probe(struct platform_device *pdev)
> +{
...
> +	led_cdev->brightness_set_blocking = sgm3140_brightness_set;
> +	led_cdev->max_brightness = LED_ON;

Don't do this, unless you really have 255 levels of brightness.

> +	/* Create V4L2 Flash subdev */
> +	priv->v4l2_flash = v4l2_flash_init(&pdev->dev,
> +					   child_node,
> +					   fled_cdev, NULL,
> +					   &v4l2_sd_cfg);
> +	if (IS_ERR(priv->v4l2_flash)) {

Does this need some #ifdef guards?

> +		ret = PTR_ERR(priv->v4l2_flash);
> +		goto err;
> +	}
> +
> +	return ret;

Should this return 0?

> +err:
> +	fwnode_handle_put(child_node);
> +	return ret;
> +}

Does non-error path needs handle_put, too?

Best regards,
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2020-04-27  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 19:13 [PATCH v3 0/2] Add sgm3140 flash led driver Luca Weiss
2020-04-21 19:13 ` [PATCH v3 1/2] dt-bindings: leds: Add binding for sgm3140 Luca Weiss
2020-04-21 19:13 ` [PATCH v3 2/2] leds: add sgm3140 driver Luca Weiss
2020-04-27  9:51   ` Pavel Machek [this message]
2020-04-27 19:49     ` Luca Weiss
2020-04-27 21:10       ` Jacek Anaszewski

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=20200427095102.GA21572@duo.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=devicetree@vger.kernel.org \
    --cc=dmurphy@ti.com \
    --cc=heiko@sntech.de \
    --cc=icenowy@aosc.io \
    --cc=jacek.anaszewski@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=mark.rutland@arm.com \
    --cc=mripard@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).