Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1379321pxf; Fri, 26 Mar 2021 06:53:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhDH/aOx1K+rzMnhz+DC8yKq+23pXPlDeKc1CMsRH23AMZDhtMLCmIRx75XLV6iQ0pWA1A X-Received: by 2002:aa7:d74d:: with SMTP id a13mr15833717eds.199.1616766826831; Fri, 26 Mar 2021 06:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616766826; cv=none; d=google.com; s=arc-20160816; b=B9fioEK494Gqhu2mhxui8vV4xtZslAP0PU0xkfjqP+iQY+GopvZariB7svfi19X9N9 m6s5kQwGx0Z3RPkqRvDEkrMyPGxYtVUBnmLi3kFLEutPJ7VqBnrM8DY4i8VH3MmB9S9Y GmIqq/4vwuKWOWx3dgzJOIlaLeQBOAFed37eIA6PJarFXH29cfcoIaAl37t2ttCkstEe oj/BGGU05zh5bSHuB4vRLvQCPcizUxLNhUMBQJxodh//fkZe4d9z9hCz7nZ3ebvWc3/2 xPjsfDUTbUmmUKvvYPHFZ5mlWlKdCN+4cAz9MYmlWWndrTL1RCz83FbkOwpdRI31cN8a 8/Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=NkhLneCi/gum9BK6s+iV3Vbv/kZ2vsodWQCj/HwmtKo=; b=ZDYb+FtAuvWmBtau4DCG4GZlREHrcO/g0toxulxjh5EkloIh7GUN2cAczCTZNnuSeB 1Ntecx0+aN2Jt0QrRGY1CSfvyD+W3QjuykJm4nM1IOH6GHgIKOLVrnRwMlTe4AUICCzw dBy4XAXypYH2ipUT4edKcqbnfbAmM1XpETZdjOUb3PeMPGi9gKg29czXWOH6SXlNhEEf dalUM73YYo48v9xtLyuAanwTMVV1x2rvji/ByejrS0krLZu2SMZYWNjbFttQII6kH+X7 nKBsJf3MD+CUNOvpS/RtMX8YC+1vPCmC/fUA5H6Zhbs7Rvr98vqx5e+NJwFyNVTPdO1L yLwA== 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 w19si6432245edd.32.2021.03.26.06.53.22; Fri, 26 Mar 2021 06:53:46 -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 S230170AbhCZNuE (ORCPT + 99 others); Fri, 26 Mar 2021 09:50:04 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:58144 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbhCZNtn (ORCPT ); Fri, 26 Mar 2021 09:49:43 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 117891C0B79; Fri, 26 Mar 2021 14:49:40 +0100 (CET) Date: Fri, 26 Mar 2021 14:49:39 +0100 From: Pavel Machek To: Hermes Zhang Cc: dmurphy@ti.com, robh+dt@kernel.org, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, chenhuiz@axis.com, lkml@axis.com, kernel@axis.com Subject: Re: [PATCH v2 2/2] leds: leds-multi-gpio: Add multiple GPIOs LED driver Message-ID: <20210326134939.GA11578@duo.ucw.cz> References: <20210326052801.17666-1-chenhui.zhang@axis.com> <20210326052801.17666-3-chenhui.zhang@axis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: <20210326052801.17666-3-chenhui.zhang@axis.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > Introduce a new multiple GPIOs LED driver. This LED will made of > multiple GPIOs (up to 8) and will map different brightness to different > GPIOs states which defined in dts file. >=20 > Signed-off-by: Hermes Zhang > index 000000000000..7aef82701f86 > --- /dev/null > +++ b/drivers/leds/simple/Kconfig > @@ -0,0 +1,23 @@ > +menuconfig LEDS_SIMPLE > + bool "Simple LED support" > + depends on LEDS_CLASS > + help > + This option enables simple leds support for the leds class. > + If unsure, say Y. No need for new config symbol. > + if (ret !=3D 1 << gpios->ndescs) { I'd do (ret !=3D (1 << gpios->ndescs)) > + priv =3D devm_kzalloc(dev, sizeof(struct multi_gpio_led_priv) > + + sizeof(u8) * nr_states , GFP_KERNEL); Sizeof(u8) is always 1, no need for space before , .=20 > + of_property_read_string(node, "default-state", &state); > + if (!strcmp(state, "on")) > + multi_gpio_led_set(&priv->cdev, priv->cdev.max_brightness); > + else > + multi_gpio_led_set(&priv->cdev, 0); No need for default-state handling, unless you are using it. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYF3mcwAKCRAw5/Bqldv6 8iiPAJ47/ujR5FS1TCSuqXA9z24+8Rw4oACgsOhBEfa0VYT6Dm0hl4/t3FGpQx8= =ox8t -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j--