From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 718FCC433E0 for ; Tue, 21 Jul 2020 21:07:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40B4420720 for ; Tue, 21 Jul 2020 21:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iE56hDig" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40B4420720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Q8+5YLbSHQxN9OFZJ+TFNf4NZW9DMCvZtxAQfDyHPqQ=; b=iE56hDigf92CNgeo9PoXZhZdc RkUJdBfqZcyL8kSkJtQNeUg9Nb+S7lg5ADGvUMUyyHpAAgL8UUK/KmNYjZQZe0rzK07pmag/McK/Y SHEoXixOC1F1vPQnYFaGeV+vgLf3yUVaFbQPrhCM/tXA5NwAZGzNNYWGHtkBSLCSKF4+A7RS+zihS Wm0dikthBzt6YWCE8//IXPD5Y4f2xzSvZVkoEy5uh1ow9JgRzFuUx7Hjub5EQnBpa+OZQv2L2xlYp TqmHNJA/Fp3YKcJbq/PrI/gdqOTtccUG3sTfBmGkvUmvG5Ki+Lpqcbh/ureBXCWdMH8ZgVqg9hHUn I8uM+UGrw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxzSY-0001Qj-G2; Tue, 21 Jul 2020 21:05:58 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxzSW-0001QO-FR for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2020 21:05:57 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 6F7D21C0BD8; Tue, 21 Jul 2020 23:05:54 +0200 (CEST) Date: Tue, 21 Jul 2020 23:05:54 +0200 From: Pavel Machek To: Dan Murphy Subject: Re: [PATCH v31 03/12] leds: lp50xx: Add the LP50XX family of the RGB LED driver Message-ID: <20200721210554.GC5966@amd> References: <20200716182007.18389-1-dmurphy@ti.com> <20200716182007.18389-4-dmurphy@ti.com> MIME-Version: 1.0 In-Reply-To: <20200716182007.18389-4-dmurphy@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_170556_654306_D96D6B87 X-CRM114-Status: GOOD ( 16.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, marek.behun@nic.cz, jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org Content-Type: multipart/mixed; boundary="===============1330222880502959012==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============1330222880502959012== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B4IIlcmfBL/1gGOG" Content-Disposition: inline --B4IIlcmfBL/1gGOG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > The device has the ability to group LED output into control banks > so that multiple LED banks can be controlled with the same mixing and > brightness. Inversely the LEDs can also be controlled independently. Inversely? > --- /dev/null > +++ b/drivers/leds/leds-lp50xx.c > @@ -0,0 +1,784 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// TI LP50XX LED chip family driver > +// Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ > + Can we get https here and in the binding document? Please run this through checkpatch -- I believe it will have some comments. > + > + device_for_each_child_node(priv->dev, child) { > + led =3D &priv->leds[i]; > + ret =3D fwnode_property_count_u32(child, "reg"); > + if (ret < 0) { > + dev_err(&priv->client->dev, > + "reg property is invalid\n"); > + return -EINVAL; is handle_put(child) needed here? > + } > + if (ret > 1) { > + priv->num_of_banked_leds =3D ret; > + if (priv->num_of_banked_leds > > + priv->chip_info->max_modules) { > + dev_err(&priv->client->dev, > + "reg property is invalid\n"); > + ret =3D -EINVAL; > + fwnode_handle_put(child); > + goto child_out; > + } > + > + ret =3D fwnode_property_read_u32_array(child, > + "reg", > + led_banks, > + ret); Move this to subfunction to reduce the indentation? (Or, just refactor it somehow). > + if (ret) { > + dev_err(&priv->client->dev, > + "reg property is missing\n"); > + fwnode_handle_put(child); > + goto child_out; > + } Create label that does the handle_put so you don't need to repeat it quite so often? > + fwnode_for_each_child_node(child, led_node) { > + ret =3D fwnode_property_read_u32(led_node, "color", > + &color_id); > + if (ret) > + dev_err(priv->dev, "Cannot read color\n"); > + > + mc_led_info[num_colors].color_index =3D color_id; This uses undefined value. > + ret =3D lp50xx_reset(led); Does the GPIO need to be disabled before enabling it for reset? Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --B4IIlcmfBL/1gGOG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl8XWLIACgkQMOfwapXb+vKuOQCgoxrMbavmy/NClUkh98BWFE7Z uvkAnREYqZYfPNmsTX6foeWu/G5wodi/ =XmHi -----END PGP SIGNATURE----- --B4IIlcmfBL/1gGOG-- --===============1330222880502959012== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============1330222880502959012==--