From patchwork Thu Jun 3 08:18:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 453225 Delivered-To: patch@linaro.org Received: by 2002:a02:c735:0:0:0:0:0 with SMTP id h21csp72117jao; Thu, 3 Jun 2021 01:20:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJya542TTaHUVBzJdUAlujtTPCAlDE1u/ZAXhoIYh/hJIAsGXCl2jBR/5hGMGGsS3AlQ+NrS X-Received: by 2002:a05:6402:4316:: with SMTP id m22mr7840537edc.316.1622708405116; Thu, 03 Jun 2021 01:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622708405; cv=none; d=google.com; s=arc-20160816; b=ISGOYZic2GRDBM4xxfjll5pPqN1ho+f1f9sxYxYUJFXfvtze8macwrJhy1Jckht7lx dWrXNow7TYoLCuwYuVxo/iEL6VyLu82sx8tXFpzc2K0lhk9yZRW1/qJ4sbB6KfaP8HII adyigysT06GiT4c2Ca9pG9sNCjae07od2Yung/QnWP7uJp8S5lTj2uoWiDhCGBh6kwZu I0D+04Q6W3KWlfMzedmNM8nnTcEuF8TvyL51oV7yPueO8O0kHtSxUkW/FEjxG8VoSDkX zQZ/9WnO4UslUyWkEB4nRTxmAIY1KYRyjidaumj9JnTz+NMlk9CTA7mCfFIOFUh5o4lO djQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=/sNX4mumXu2c+Ng1l217/qU0peCUh1MdGzV1rqEY8zk=; b=e7/E9oNfE0cs1zFu9osGMKbS2aY87ySLdzwxQFwGkfpsR3ujZB+DUMVVbCU6n3pp08 lp0daCOfnG6pkjZcTba8H2A0BN6W5thuLs0xV2zq9MiOTmaZe8tP4mpXZuGi9R4sOlaB bLhjM01nocLLie3KHZdhAdiZxu62HPSHS3xaxYoPaSj4wHKjil3+U7wf/pfxi8SpUwMK 5fGfBwKR54c82bzt1Jf4BZErHuybVn2VCvzwKokk9n+E+oTswtVQ67zqbePj7UK7jjWT mZkUX86SB3R7WeSGqcJguHcVc2ILX8D9qypzaN1xMskLebWJ1r5THB6Z/q/cOzgyKDpN CWfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NNnZFIsl; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-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 h21si1648630ejt.172.2021.06.03.01.20.04 for ; Thu, 03 Jun 2021 01:20:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NNnZFIsl; spf=pass (google.com: domain of linux-leds-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229486AbhFCIVs (ORCPT ); Thu, 3 Jun 2021 04:21:48 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:44568 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhFCIVr (ORCPT ); Thu, 3 Jun 2021 04:21:47 -0400 Received: by mail-pj1-f48.google.com with SMTP id h12-20020a17090aa88cb029016400fd8ad8so3391815pjq.3 for ; Thu, 03 Jun 2021 01:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/sNX4mumXu2c+Ng1l217/qU0peCUh1MdGzV1rqEY8zk=; b=NNnZFIslIEAs3i1dDDoFryJpGlhlZVLUnJR9YXE3+MhBm8dRLRIRZzhxs4PFkZ0RvR biulvUcDQjwca9L7PLx82ToRTyoysNoNDbZB88bsM8TGSpxh1iJDXCTZw19+qLaO4WF0 xZjqVmwDuYsU+510k/q4kkS18413TUXgnb9Z2G1dPJZ+IHrZOr2NVStyMsXHFf/FSbWv rsv4lIBsPr3a4pYM+4bGnZ29rbiRbYEtMt6d01FPpSfAaQBBuTOciaAwfujBT8V5+g7D VPti16FpaI2AYrVOb8ZjV6qQnmeN93/deEyCxZUbbxX05Ar4uRlWl3RMVjCEb8KDiBbf HFaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=/sNX4mumXu2c+Ng1l217/qU0peCUh1MdGzV1rqEY8zk=; b=MBBETMjPAAqcPKi+QmFGHCZpGA5+0KgQE8I/Kar0hHzKl5wbxAy73ZPHhYPfVQ0wnl NHhcX1oxYLOqpv+1AS/tokPMgdfz3lxAi1H5VDgfPzwcs8EcZBlTWB1jHwX7k48h5mle /7HHmP3o7cG4QmgLM0RC/+NHEgj75jjXLR8Nt00N7FybhTkG/kRF9zbLIJRgAf+SaR7k u5y60CZwCjDRU+m8H9l3Zmiho8Ja9I0cJdkPmQBc1XmTvDFpDeK9Pb85lzExpFOfHwil mELkca9ZEPN1cCEKCfuGddpkNMcvjV79eksGUSGFEzfZqv+vSafLG7fbay6RBgYARYF+ 5MLQ== X-Gm-Message-State: AOAM533PHFUNhXCca6IONM8jPh7vA0UmyOiEWxZJhiTt/TDUceZL2LXV K4BgF+5mWSaqhRTaazSOIB0= X-Received: by 2002:a17:90a:71c7:: with SMTP id m7mr9931392pjs.9.1622708343375; Thu, 03 Jun 2021 01:19:03 -0700 (PDT) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id 2sm1588101pjg.0.2021.06.03.01.18.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 01:19:02 -0700 (PDT) Sender: "joel.stan@gmail.com" From: Joel Stanley To: Pavel Machek Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= , Andrew Jeffery , Vishwanatha Subbanna , linux-leds@vger.kernel.org Subject: [PATCH v2] leds: pca955x: Allow platform datato set full name Date: Thu, 3 Jun 2021 17:48:41 +0930 Message-Id: <20210603081841.208639-1-joel@jms.id.au> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org The PCA955x driver since it was merged has added a "pca955x:" prefix to LED names. This meanas platform data (such as the device tree) cannot fully control the name. Here's what this produces using the example in the device tree bindings: # ls /sys/class/leds/ pca955x:green:power/ pca955x:pca9552:white/ pca955x:pca9552:yellow/ pca955x:red:power/ Instead use the platform data when provided to name the LED device. Signed-off-by: Joel Stanley --- v2: Drop kconfig option, per Pavel's review: > No. Config option is not acceptable for this. > > Just delete the prefix and fix the breakage. drivers/leds/leds-pca955x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c index 7087ca4592fc..4c5cc62c107a 100644 --- a/drivers/leds/leds-pca955x.c +++ b/drivers/leds/leds-pca955x.c @@ -503,9 +503,9 @@ static int pca955x_probe(struct i2c_client *client, snprintf(pdata->leds[i].name, sizeof(pdata->leds[i].name), "%d", i); - snprintf(pca955x_led->name, - sizeof(pca955x_led->name), "pca955x:%s", - pdata->leds[i].name); + strscpy(pca955x_led->name, + pdata->leds[i].name, + sizeof(pca955x_led->name)); if (pdata->leds[i].default_trigger) pca955x_led->led_cdev.default_trigger =