Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4712519ybl; Sat, 21 Dec 2019 12:27:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxzGq9zIY1T8N/qaotedNg+1cXsBr8xklAQTB6EM5ALOJC5q8Yjrg3AD6dBGIc6eJ3xYVdo X-Received: by 2002:a9d:6e03:: with SMTP id e3mr7113948otr.46.1576960067541; Sat, 21 Dec 2019 12:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576960067; cv=none; d=google.com; s=arc-20160816; b=ovNOO4xZPpouHgAVqYoVnak6TWp5pgAJoltin1bVKNCRfR5w7Cho5zYOqM/M2PjqAE OQkap8hnDBzDTHK0mFLl8uevztJtc0momHx1Ia+3jDcMB7ARNrKx12J434g86ZgOE1Di DFfsqoghEO9KuECcBFA95ixk6P/1P4i6VmQeSWWUPUr+UIYBKVdtgXm0be90G8jUQVgJ iZXi/OnF4Yn5mxuDCMhpOevgzkuFj2bOfaho9rgeXf4RLpe8zziKNub9UIyAtMS3mLql uACiAanfWGEjA58pSzcgqWtu0cILy7ZGo1ZWj69lGImLg+7ypBsyH+yfYc+5AwD9kgB3 okdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=2lLX3yIQeXXP7FLpx1+E5wtRT/tqet9QEfxDN9904Oo=; b=tjD73HvA0v3G3vDIECKrU2aXo2feftkgZBOnpn0sDxoVAlrJJTxMGcaVkvHW3nch0m NWefqGwixzA8wHKNctzskmK192RKTFZ6E+8GxRmMkZdAagSrleC1TbuIgBPwfGYjxy2h 8bfHbUGwqy2eqyyFW9dHRWFfMX68QxrBtwIy7vaAzYzCrIXVYdIAmSKvPLj/CLRWb135 T++x12cW4g4b1+AiSGS/cixHpYkJd4rwc0+TkbsYh6K0MFs3fJSpFlBNoblHjtmCh1/o J/0FAwwNM550MsKOFA4iperbRgQe6v8ooydSMCTGKM5MnFgPkJZpiNnMILYnIZdUJqui cheA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="MEZhPkj/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si6372279oix.48.2019.12.21.12.27.35; Sat, 21 Dec 2019 12:27:47 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="MEZhPkj/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727339AbfLUUSA (ORCPT + 99 others); Sat, 21 Dec 2019 15:18:00 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51535 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbfLUUSA (ORCPT ); Sat, 21 Dec 2019 15:18:00 -0500 Received: by mail-wm1-f65.google.com with SMTP id d73so12198526wmd.1; Sat, 21 Dec 2019 12:17:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2lLX3yIQeXXP7FLpx1+E5wtRT/tqet9QEfxDN9904Oo=; b=MEZhPkj/kpS21k/jnelmsp0v4dF6KLG6qBF2x0C6nXH3lXw2DHF9v0iY6P2bMSj11g SbMiOL8DwYoCmj/7k29a3ScIlq7I4bnFzgzJ30i4gSJtHG6NYNZS31X7dlzyS5QYfSow pYXiHmfMa0nQGtwUwTeFblDUpJy0/bDzBRXEHRD0pDzvpfpdLVWJWHCdcliGsWYmDX0R 7aq2QWKBay1t1arpWQaf0yL2cu05yF5Pau7jlKZX6OQcGiRDmiDTjmZpiRI1oB7uVFAK cbvueIPXwd5eZVd6R36HcV6QTXGvnm338KxYb4U28PpxNtlCXQ4s4llX9jeM0l0qIvzj PGig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=2lLX3yIQeXXP7FLpx1+E5wtRT/tqet9QEfxDN9904Oo=; b=AiAjxRvscIYGm7lcnTAe2JtkPDgOdb+7kViH+SgsMDbsiuBZhhE2IIYYffhHworzYF lG+RXUukIPqf42i7SOrVo4S/iFrxQaM+JAEzPKrnl3ecGwuTj4fefGrlWuOAkLmqEWfF lMOQnPub3EosdI9JROJREuOXFc3ae9Femf6xBGMiol6/jt4e2QrZmRjKp067QWIq2pT8 7WT4IU+fGmDPn2IYrJtPms+Y6Q+9iZJwkawhyedDAnP9CICrqbnrDw1kORjuJbemDmNC cnheumjKDOoUTP3V/X3+wrjyk9iioX0xrJbHuFI8Io/jX+GyrBpR16KOCDRPqPXN2A0t iqiw== X-Gm-Message-State: APjAAAUcjjUq+YALC96Snr+SMhhUFKK6ykTCQYDzsTy7ZTGBsvZ9poRk ZrbwiZJD6UI+8me8mhsds4c= X-Received: by 2002:a1c:740b:: with SMTP id p11mr24627282wmc.78.1576959476997; Sat, 21 Dec 2019 12:17:56 -0800 (PST) Received: from [192.168.1.19] (bfd180.neoplus.adsl.tpnet.pl. [83.28.41.180]) by smtp.gmail.com with ESMTPSA id n10sm14048030wrt.14.2019.12.21.12.17.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 21 Dec 2019 12:17:56 -0800 (PST) Subject: Re: [PATCH] leds: gpio: Fix uninitialized gpio label for fwnode based probe To: Pavel Machek Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Russell King References: <20191205212501.9163-1-jacek.anaszewski@gmail.com> <20191221184957.GD32732@amd> From: Jacek Anaszewski Autocrypt: addr=jacek.anaszewski@gmail.com; prefer-encrypt=mutual; keydata= xsFNBFWjfaEBEADd66EQbd6yd8YjG0kbEDT2QIkx8C7BqMXR8AdmA1OMApbfSvEZFT1D/ECR eWFBS8XtApKQx1xAs1j5z70k3zebk2eeNs5ahxi6vM4Qh89vBM46biSKeeX5fLcv7asmGb/a FnHPAfQaKFyG/Bj9V+//ef67hpjJWR3s74C6LZCFLcbZM0z/wTH+baA5Jwcnqr4h/ygosvhP X3gkRzJLSFYekmEv+WHieeKXLrJdsUPUvPJTZtvi3ELUxHNOZwX2oRJStWpmL2QGMwPokRNQ 29GvnueQdQrIl2ylhul6TSrClMrKZqOajDFng7TLgvNfyVZE8WQwmrkTrdzBLfu3kScjE14Q Volq8OtQpTsw5570D4plVKh2ahlhrwXdneSot0STk9Dh1grEB/Jfw8dknvqkdjALUrrM45eF FM4FSMxIlNV8WxueHDss9vXRbCUxzGw37Ck9JWYo0EpcpcvwPf33yntYCbnt+RQRjv7vy3w5 osVwRR4hpbL/fWt1AnZ+RvbP4kYSptOCPQ+Pp1tCw16BOaPjtlqSTcrlD2fo2IbaB5D21SUa IsdZ/XkD+V2S9jCrN1yyK2iKgxtDoUkWiqlfRgH2Ep1tZtb4NLF/S0oCr7rNLO7WbqLZQh1q ShfZR16h7YW//1/NFwnyCVaG1CP/L/io719dPWgEd/sVSKT2TwARAQABzS1KYWNlayBBbmFz emV3c2tpIDxqYWNlay5hbmFzemV3c2tpQGdtYWl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PcHjMi2Va8yw KTj/JgcpUO5KN906Pf7ywZISe7Kbcc/qnE0YjPPSqFOvoeZvHe6EZCMW9+xZsaipvlqpByQV UHnVg09K9YFvjUBsBPdC8ef6YwgfR9o6AnPmxl0oMUIXkCCC5c99fzJY/k8= Message-ID: <7ff6e22f-537a-e205-db19-a75d33af8487@gmail.com> Date: Sat, 21 Dec 2019 21:17:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <20191221184957.GD32732@amd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/21/19 7:49 PM, Pavel Machek wrote: > 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 '?'. >> >> It could be observed in debugfs and failed to properly identify >> gpio association with LED consumer. >> >> Fix this shortcoming by updating the GPIO label after the LED is >> registered and its final name is known. >> >> Fixes: d7235f5feaa0 ("leds: gpio: Use generic support for composing LED names") >> 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(struct platform_device *pdev) >> struct gpio_led led = {}; >> const char *state = NULL; >> >> + /** >> + * 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 = devm_fwnode_get_gpiod_from_child(dev, NULL, child, >> GPIOD_ASIS, >> - led.name); >> + NULL); > > This is not linuxdoc, so comment should beging with /* AFAICT. Right. > I'll probably hand-edit the patch. Sure, thanks. -- Best regards, Jacek Anaszewski