lkml.org 
[lkml]   [2020]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/2] leds: add sgm3140 driver
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-04-27 11:51    [W:0.108 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site