Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3523555imu; Wed, 7 Nov 2018 11:38:46 -0800 (PST) X-Google-Smtp-Source: AJdET5cnKAtxbRmvmapQaIVz/ds+ZhTxkyAvshj9/jIVIS0d5lcIxn26pezHuaBn7j0h0ZH/1xLV X-Received: by 2002:a17:902:b701:: with SMTP id d1-v6mr1482939pls.29.1541619526933; Wed, 07 Nov 2018 11:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541619526; cv=none; d=google.com; s=arc-20160816; b=RIZlYY/W1pPkYvDcCBfUK0ylOcSqrXLpyr2lR5te4GEciwkp/jRtRvjNglowt53P9P F9HYQhSrSOhUUv3HJEriQKKjD1AX8X/IBImwgpM+s+FFIxbOr8pCP4RvElhMB/cvMtTb ifQe+FEDQNi0ofPpBQNpUgjTXWmDaFNMSLXg54INOrnHRovSaBj0vY9V8RiY082Yrs0f 7AKT8i6NZ+XwGqgUTsmBPcfwXhNks5LM9OqWMW5Tq4u77+l93toA5czDsbfU9XWFf1Mr Ii1caQrFdNY1386MT94mswrTWOsvdZ8MF7p6NC2BzQhgxEA77qjGiysLAt2YqqIY1gAm wDEg== 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:from:references:cc:to:subject; bh=vrDEqkfoXU5+E49NHxUgJqsK4+tHd/WEz2xwuVtI3TA=; b=ruewUNM7EytKJMqyU0BnQWolrKXAXCDRCcg+kmKRQ6wolXDQ+QPGpO13bGGqXfbfqK ZdwQyHhJiF1OCfcgk/nSrLkyjGbjd9NNVP7SFIxITAGAc69UbZMXlOZ2NpiUAFXVotiJ /lJBJ9wR0fXG+5GqDLWKG1ecCbPUY0pmknbARCZGTraQRKOhQotZ3yfg7GBnEwj4a2Sf oDR1UM2/BWIwVGfKiowEKOpIcAb7jvsH3vmIgAb3pEYk3ukMOZBRs7MNZ3kml+mQIkqU exX9b/14VUm7B2w0O5MX6yI5CZdYEmLZ7tMLcwxtY8H+O5SkdBLLjvsnWROI8F5LO+un o9SA== 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 l12-v6si1582302plc.54.2018.11.07.11.38.22; Wed, 07 Nov 2018 11:38:46 -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 S1726869AbeKHFJl (ORCPT + 99 others); Thu, 8 Nov 2018 00:09:41 -0500 Received: from mail.bugwerft.de ([46.23.86.59]:55032 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725953AbeKHFJl (ORCPT ); Thu, 8 Nov 2018 00:09:41 -0500 Received: from [192.168.178.170] (pD95EFA86.dip0.t-ipconnect.de [217.94.250.134]) by mail.bugwerft.de (Postfix) with ESMTPSA id 3701E2A75B8; Wed, 7 Nov 2018 19:35:32 +0000 (UTC) Subject: Re: [PATCH 08/24] leds: lt3593: Use led_compose_name() To: Jacek Anaszewski , linux-leds@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, robh@kernel.org References: <1541542052-10081-1-git-send-email-jacek.anaszewski@gmail.com> <1541542052-10081-9-git-send-email-jacek.anaszewski@gmail.com> From: Daniel Mack Message-ID: <42d68eae-6905-e787-3797-f0f16b0dfb84@zonque.org> Date: Wed, 7 Nov 2018 20:37:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1541542052-10081-9-git-send-email-jacek.anaszewski@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed 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 6/11/2018 11:07 PM, Jacek Anaszewski wrote: > Switch to using generic LED support for composing LED class > device name. Thanks for the rework! > Signed-off-by: Jacek Anaszewski > --- > drivers/leds/leds-lt3593.c | 19 ++++++++----------- > 1 file changed, 8 insertions(+), 11 deletions(-) > > diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c > index de3623e..d005abc 100644 > --- a/drivers/leds/leds-lt3593.c > +++ b/drivers/leds/leds-lt3593.c > @@ -10,10 +10,10 @@ > #include > #include > #include > -#include > + > +#define LED_LT3593_NAME "lt3593" > > struct lt3593_led_data { > - char name[LED_MAX_NAME_SIZE]; > struct led_classdev cdev; > struct gpio_desc *gpiod; > }; > @@ -111,6 +111,7 @@ static int lt3593_led_probe(struct platform_device *pdev) > struct fwnode_handle *child; > int ret, state = LEDS_GPIO_DEFSTATE_OFF; > enum gpiod_flags flags = GPIOD_OUT_LOW; > + struct led_init_data init_data; > const char *tmp; > > if (dev_get_platdata(dev)) { > @@ -138,14 +139,11 @@ static int lt3593_led_probe(struct platform_device *pdev) > return PTR_ERR(led_data->gpiod); > > child = device_get_next_child_node(dev, NULL); > + init_data.fwnode = child; Not quite following. `fwnode' is the only member of that struct that is initialized? > > - ret = fwnode_property_read_string(child, "label", &tmp); > - if (ret < 0) > - snprintf(led_data->name, sizeof(led_data->name), > - "lt3593::"); > - else > - snprintf(led_data->name, sizeof(led_data->name), > - "lt3593:%s", tmp); > + ret = led_compose_name(child, LED_LT3593_NAME, ":", init_data.name); ... and here, a member that wasn't written before is used? What am I missing? Thanks, Daniel