From patchwork Tue Dec 14 14:27:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 523833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D00CC433F5 for ; Tue, 14 Dec 2021 14:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232577AbhLNO1l (ORCPT ); Tue, 14 Dec 2021 09:27:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:28000 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbhLNO1l (ORCPT ); Tue, 14 Dec 2021 09:27:41 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="236519594" X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="236519594" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 06:27:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="754828313" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 14 Dec 2021 06:27:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5C0FF15C; Tue, 14 Dec 2021 16:27:41 +0200 (EET) From: Andy Shevchenko To: Pavel Machek , Andy Shevchenko , Amireddy Mallikarjuna reddy , Yihao Han , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] leds: tca6507: Get rid of duplicate of_node assignment Date: Tue, 14 Dec 2021 16:27:38 +0200 Message-Id: <20211214142739.60071-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Call graph: --> tca6507_probe_gpios() --> gpiochip_add_data() --> gpiochip_add_data_with_key() --> of_gpio_dev_init() Signed-off-by: Andy Shevchenko --- v2: added call graph to the commit message (Pavel) drivers/leds/leds-tca6507.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c index de8eed9b667d..1473ced8664c 100644 --- a/drivers/leds/leds-tca6507.c +++ b/drivers/leds/leds-tca6507.c @@ -641,9 +641,6 @@ static int tca6507_probe_gpios(struct device *dev, tca->gpio.direction_output = tca6507_gpio_direction_output; tca->gpio.set = tca6507_gpio_set_value; tca->gpio.parent = dev; -#ifdef CONFIG_OF_GPIO - tca->gpio.of_node = of_node_get(dev_of_node(dev)); -#endif err = gpiochip_add_data(&tca->gpio, tca); if (err) { tca->gpio.ngpio = 0; From patchwork Tue Dec 14 14:27:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 526753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B0CDC433EF for ; Tue, 14 Dec 2021 14:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbhLNO1i (ORCPT ); Tue, 14 Dec 2021 09:27:38 -0500 Received: from mga06.intel.com ([134.134.136.31]:63265 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231845AbhLNO1g (ORCPT ); Tue, 14 Dec 2021 09:27:36 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="299765346" X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="299765346" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 06:27:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="519235252" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 14 Dec 2021 06:27:34 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 675AC81; Tue, 14 Dec 2021 16:27:41 +0200 (EET) From: Andy Shevchenko To: Pavel Machek , Andy Shevchenko , Amireddy Mallikarjuna reddy , Yihao Han , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment Date: Tue, 14 Dec 2021 16:27:39 +0200 Message-Id: <20211214142739.60071-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211214142739.60071-1-andriy.shevchenko@linux.intel.com> References: <20211214142739.60071-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Call graph: --> sso_gpio_gc_init() --> devm_gpiochip_add_data --> devm_gpiochip_add_data_with_key --> gpiochip_add_data_with_key() --> of_gpio_dev_init() Signed-off-by: Andy Shevchenko --- v2: new patch drivers/leds/blink/leds-lgm-sso.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/leds/blink/leds-lgm-sso.c b/drivers/leds/blink/leds-lgm-sso.c index fd8b7573285a..6f270c0272fb 100644 --- a/drivers/leds/blink/leds-lgm-sso.c +++ b/drivers/leds/blink/leds-lgm-sso.c @@ -477,7 +477,6 @@ static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv) gc->ngpio = priv->gpio.pins; gc->parent = dev; gc->owner = THIS_MODULE; - gc->of_node = dev->of_node; return devm_gpiochip_add_data(dev, gc, priv); }