From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean-Jacques Hiblot Subject: [PATCH v2 2/2] leds: tlc591xx: Use the OF version of the LED registration function Date: Mon, 8 Jul 2019 12:06:20 +0200 Message-ID: <20190708100620.22388-3-jjhiblot@ti.com> References: <20190708100620.22388-1-jjhiblot@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <20190708100620.22388-1-jjhiblot@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: jacek.anaszewski@gmail.com, pavel@ucw.cz, dmurphy@ti.com Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com, Jean-Jacques Hiblot List-Id: linux-leds@vger.kernel.org The driver parses the device-tree to identify which LED should be handled. Since the information about the device node is known at this time, we can provide the LED core with it. It may be useful later. Signed-off-by: Jean-Jacques Hiblot Acked-by: Pavel Machek --- drivers/leds/leds-tlc591xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index 3d5a4b92f016..10764a62cb71 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -207,7 +207,7 @@ tlc591xx_probe(struct i2c_client *client, led->led_no = reg; led->ldev.brightness_set_blocking = tlc591xx_brightness_set; led->ldev.max_brightness = LED_FULL; - err = devm_led_classdev_register(dev, &led->ldev); + err = devm_of_led_classdev_register(dev, child, &led->ldev); if (err < 0) { dev_err(dev, "couldn't register LED %s\n", led->ldev.name); -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 161BAC606AB for ; Mon, 8 Jul 2019 10:06:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E373D20644 for ; Mon, 8 Jul 2019 10:06:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="qfoDhx/a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729247AbfGHKGk (ORCPT ); Mon, 8 Jul 2019 06:06:40 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:56552 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729324AbfGHKGd (ORCPT ); Mon, 8 Jul 2019 06:06:33 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x68A6T9j041416; Mon, 8 Jul 2019 05:06:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1562580389; bh=4hFShXBEewLwhXK6VD3Owlrh0+FXTvSoOIUdw/wVZQA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qfoDhx/aKditTQq3vGh0YuCFAML2QV0U8RLudPVA8igS4mFS/d7vVh+neVzttM7pc rkDDVqDXqLID09VmoIAiNT0PAZreNoGI9lxJE9s9deq9wwOY7qrg4Fkxh+47bar4W/ r20kvXfJg5yGbmM14wnBVLX7gfg0VUdH5yDZq9tU= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x68A6TgK045289 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 8 Jul 2019 05:06:29 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 8 Jul 2019 05:06:29 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 8 Jul 2019 05:06:29 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x68A6StD042780; Mon, 8 Jul 2019 05:06:28 -0500 From: Jean-Jacques Hiblot To: , , CC: , , , Jean-Jacques Hiblot Subject: [PATCH v2 2/2] leds: tlc591xx: Use the OF version of the LED registration function Date: Mon, 8 Jul 2019 12:06:20 +0200 Message-ID: <20190708100620.22388-3-jjhiblot@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190708100620.22388-1-jjhiblot@ti.com> References: <20190708100620.22388-1-jjhiblot@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Message-ID: <20190708100620.XFkcrFq0ldwBpTNSogZhqGRawWPCwrSy5kQGWLuZCP4@z> The driver parses the device-tree to identify which LED should be handled. Since the information about the device node is known at this time, we can provide the LED core with it. It may be useful later. Signed-off-by: Jean-Jacques Hiblot Acked-by: Pavel Machek --- drivers/leds/leds-tlc591xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index 3d5a4b92f016..10764a62cb71 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -207,7 +207,7 @@ tlc591xx_probe(struct i2c_client *client, led->led_no = reg; led->ldev.brightness_set_blocking = tlc591xx_brightness_set; led->ldev.max_brightness = LED_FULL; - err = devm_led_classdev_register(dev, &led->ldev); + err = devm_of_led_classdev_register(dev, child, &led->ldev); if (err < 0) { dev_err(dev, "couldn't register LED %s\n", led->ldev.name); -- 2.17.1