Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4640844ybl; Sat, 21 Dec 2019 10:51:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxugFLTRUqOiaNp9j5NlHz3vmCSzCVCjSLw43T4kD2QeNdwq2lY3DLCjkPmWqkwKzYvOuxg X-Received: by 2002:a05:6830:1689:: with SMTP id k9mr23242305otr.311.1576954317291; Sat, 21 Dec 2019 10:51:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576954317; cv=none; d=google.com; s=arc-20160816; b=PDcYR/24hx0U5olr/UAmmcHKmqUsd9qxXY706VnMfC4L2gYoKLGZfnHYxnU3nvpzQX vFtdOL37MmBX+MZOn9Ct5DJCnL1GFSJ1+bOf+NyJwoOkD+H8mfm+kWLsp/zh++ZPwMUc SZsx7AtQvShz13TWTpsfhAaiNo+6N196XoP6CgSjTRBP3GtZDHaH8V9o0VbyJzVjiKOD xvz3BkS3xJMdYiQMeFKbsKQWLl9IyaZr70hzCMGu8183QSsBAmB2R1gI/OZ7h7uEIF5b OP7yfOyoITqTCCrlAmtlIlypgJi8GmTYqFq+7fgqnE4XbBb2jMjBykWc1gGQQbeykJfk hHCg== 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=zXjRddhqqZ1iiDfb20zkSILAHuMnoJqpd4ONMVrPYL4=; b=sA/aIBmAvTBZnSpDvif1hDZX2aYqSS+cQeqbXVeSFDzsNaizwY/3Wo45U6hoYW9rPe WcZ2epDSGBF/o1f17Ykrl0nTnHXeglLTbBcDH5Ku3XXqdu5FbIccSy3vwktaDdR1vrgf DH5SzqA9i/JfGU2Wam5axn/R/mNrz8QHC5DUb41FFnaQczzdoV3T3bAlFGSe8+DoLR4J bO2s36x1Uvk1TGp4WZ7VRx1rugMnATpGJqyhBUhXARv6/XPM4Oc+U2QZz+vrkRELtABK JQ2l5yXECe5Lyok1NV9O4WLvSGqJSCJL8onjvv3w/Verto0Lutdw5CqEHxhjgYscnj0d 53zg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f204si1049307oia.43.2019.12.21.10.51.44; Sat, 21 Dec 2019 10:51:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfLUSuA (ORCPT + 99 others); Sat, 21 Dec 2019 13:50:00 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:40338 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbfLUSuA (ORCPT ); Sat, 21 Dec 2019 13:50:00 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 672B91C24A9; Sat, 21 Dec 2019 19:49:58 +0100 (CET) Date: Sat, 21 Dec 2019 19:49:57 +0100 From: Pavel Machek To: Jacek Anaszewski Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Russell King Subject: Re: [PATCH] leds: gpio: Fix uninitialized gpio label for fwnode based probe Message-ID: <20191221184957.GD32732@amd> References: <20191205212501.9163-1-jacek.anaszewski@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1sNVjLsmu1MXqwQ/" Content-Disposition: inline In-Reply-To: <20191205212501.9163-1-jacek.anaszewski@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --1sNVjLsmu1MXqwQ/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > When switching to using generic LED name composition mechanism via > devm_led_classdev_register_ext() API the part of code initializing > struct gpio_led's template name property was removed alongside. > It was however overlooked that the property was also passed to > devm_fwnode_get_gpiod_from_child() in place of "label" parameter, > which when set to NULL, results in gpio label being initialized to '?'. >=20 > It could be observed in debugfs and failed to properly identify > gpio association with LED consumer. >=20 > Fix this shortcoming by updating the GPIO label after the LED is > registered and its final name is known. >=20 > Fixes: d7235f5feaa0 ("leds: gpio: Use generic support for composing LED n= ames") > Cc: Linus Walleij > Cc: Pavel Machek > Cc: Russell King > Signed-off-by: Jacek Anaszewski Patch looks good, except: > @@ -151,9 +151,14 @@ static struct gpio_leds_priv *gpio_leds_create(struc= t platform_device *pdev) > struct gpio_led led =3D {}; > const char *state =3D NULL; > =20 > + /** > + * Acquire gpiod from DT with uninitialized label, which > + * will be updated after LED class device is registered, > + * Only then the final LED name is known. > + */ > led.gpiod =3D devm_fwnode_get_gpiod_from_child(dev, NULL, child, > GPIOD_ASIS, > - led.name); > + NULL); This is not linuxdoc, so comment should beging with /* AFAICT. I'll probably hand-edit the patch. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --1sNVjLsmu1MXqwQ/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl3+aVUACgkQMOfwapXb+vL+PQCgpPrrd5+TU6t6ly6WAIecPFXv M18An3fiw3KJqQW36jXhE2nF9Iu4vC1+ =fYNB -----END PGP SIGNATURE----- --1sNVjLsmu1MXqwQ/--