Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2700125ybz; Mon, 27 Apr 2020 02:53:22 -0700 (PDT) X-Google-Smtp-Source: APiQypKroc06y4KndsrHL0KfDAqKAL9EqvwtmkMhhRS+FYcnldY1Wv7y7Xoc9crqe/St48ChR7+D X-Received: by 2002:aa7:db41:: with SMTP id n1mr17867953edt.314.1587981202357; Mon, 27 Apr 2020 02:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587981202; cv=none; d=google.com; s=arc-20160816; b=vkxZkq8AwC5DBsgOgNfqFq2V4zbfbOyZPVyZt3b2IKRU/vS10EIQ50x59Hz8Ze2tUS gcVqyPA0j1eT3AXJ+iWKhNEck0ajAy04x+u1jAm9D+z9SLjoqaCctsk65+UkkUAPtuf4 ZyNbT+wXT11Ozim2IWa0z+d4p4VZZ0fdUx1lMKU6f/WgsepZTkUEIqt1w1OAP+8Ufmzt PGOnKnYlpXBo+1snP3lsQWRA4EIQ5hKE5bJ+HEcSHTAZr/zmFJKah7Gs2grbAZtBWFUf 46ptZBB2UjEXh+jkctQILUmzmjPpQ3GUx+CDsdIb/+FwsHvpmIJO1+YkKBh2IXi0dSL4 k0dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GveAR2gkVDuKTFxN4OKmJyd2Lysw/q52JC2GHSsWDPw=; b=Wn7wAIvLdApo2Ai9GV872ms1iiey6drDK5vnPAyTsH+wvhrCb3mKYFTtq+FU4zY1d7 yrJ5BAFD146bdx78Dle1wQVq1esAIDMFLNqJrtFBiEVuT6dGzAuQvJXmzUyiICLRyCg7 qW1tEmO4LnWXbww1qJX70J85MqKED1oxEZ3oSzITPyekMZ4Iy0/4WsmTyPDuLQDhg0nh IEjDj0PDWbcCrvKDK+7smIz9FT5WcgHSnlVZxAuFQXwuBjkC16srCPFjc16He+jiTvAS eyezg+XpNStB9OMSGKJ6kdXXRv/93TL9eNk6x2ldPKABpLFWbfVv4o7Bl69OfEh65XON cO3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si7449731edx.302.2020.04.27.02.52.58; Mon, 27 Apr 2020 02:53:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbgD0JvF (ORCPT + 99 others); Mon, 27 Apr 2020 05:51:05 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:60140 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgD0JvF (ORCPT ); Mon, 27 Apr 2020 05:51:05 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 046F01C0244; Mon, 27 Apr 2020 11:51:03 +0200 (CEST) Date: Mon, 27 Apr 2020 11:51:02 +0200 From: Pavel Machek To: Luca Weiss Cc: linux-leds@vger.kernel.org, Dan Murphy , Heiko Stuebner , Icenowy Zheng , Jacek Anaszewski , Laurent Pinchart , Mark Rutland , Maxime Ripard , Rob Herring , Shawn Guo , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH v3 2/2] leds: add sgm3140 driver Message-ID: <20200427095102.GA21572@duo.ucw.cz> References: <20200421191354.1443017-1-luca@z3ntu.xyz> <20200421191354.1443017-3-luca@z3ntu.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline In-Reply-To: <20200421191354.1443017-3-luca@z3ntu.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Add a driver for the SGMICRO SGM3140 Buck/Boost Charge Pump LED driver. >=20 > This device is controlled by two GPIO pins, one for enabling and the > second one for switching between torch and flash mode. >=20 > Signed-off-by: Luca Weiss 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) > +{ =2E.. > + led_cdev->brightness_set_blocking =3D sgm3140_brightness_set; > + led_cdev->max_brightness =3D LED_ON; Don't do this, unless you really have 255 levels of brightness. > + /* Create V4L2 Flash subdev */ > + priv->v4l2_flash =3D 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 =3D 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 --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --pWyiEgJYm5f9v55/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXqarBgAKCRAw5/Bqldv6 8tcQAKCWUTuRy7TvgT2+F1Aj1oFotUcn9wCgvlDQBHg5Trhv/KEKFw2CkG70ke8= =EEZa -----END PGP SIGNATURE----- --pWyiEgJYm5f9v55/--