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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2DF8C4332F for ; Mon, 6 Dec 2021 13:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244071AbhLFNQa (ORCPT ); Mon, 6 Dec 2021 08:16:30 -0500 Received: from mga04.intel.com ([192.55.52.120]:41243 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244041AbhLFNQ3 (ORCPT ); Mon, 6 Dec 2021 08:16:29 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="236046871" X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="236046871" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:13:01 -0800 X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="604986568" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:12:50 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1muDmW-002mwh-84; Mon, 06 Dec 2021 15:11:48 +0200 Date: Mon, 6 Dec 2021 15:11:48 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Marc Zyngier , Matti Vaittinen , Sergio Paracuellos , Chunyan Zhang , Bartosz Golaszewski , Baruch Siach , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Tony Lindgren , Nicolas Saenz Julienne , Jianqun Xu , Alexandru Ardelean , Thierry Reding , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, bcm-kernel-feedback-list@broadcom.com, linux-power@fi.rohmeurope.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, Ray Jui , Florian Fainelli , Scott Branden , Gregory Fong , Eugeniy Paltsev , Keerthy , Orson Zhai , Baolin Wang , Chunyan Zhang , Vladimir Zapolskiy , Matthias Brugger , Thierry Reding , Lee Jones , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Manivannan Sadhasivam , Heiko Stuebner , Ludovic Desroches , Maxime Coquelin , Alexandre Torgue , Jonathan Hunter Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Message-ID: References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote: > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko > wrote: > > > 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 these assignment all at once. > > > > For the details one may look into the of_gpio_dev_init() implementation. > > > > Signed-off-by: Andy Shevchenko > > This is definitely a patch in the right direction, as Bart says > it can be a bit dangerous, the outliers are those drivers that > assign the .dev to something completely different than the > the dev where the of_node is copied from. I carefully checked these all and this patch series is only for the cases when I'm sure it's the same device, which is used as parent, and its of_node supplied. > The idea was definitely always to only assign it in the core > *unless* there is a reason to have a completely different > of_node for some reason. > > > +++ b/drivers/gpio/gpio-rda.c > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev) > > rda_gpio->chip.label = dev_name(dev); > > rda_gpio->chip.ngpio = ngpios; > > rda_gpio->chip.base = -1; > > - rda_gpio->chip.parent = dev; > > - rda_gpio->chip.of_node = np; > > Mention in the commit message that in this driver > you also drop the the .parent assignment because the > core will handle it. Okay, I will update it. Also I'll update to the last codebase (dunno if Bart is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea ("gpio: bd70528 Drop BD70528 support"). -- With Best Regards, Andy Shevchenko 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE607C433F5 for ; Mon, 6 Dec 2021 13:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cIutXMsCmlD6VNZj0M3+3136s/wbInK08JV8X0BIsYU=; b=maG2uN1dAXvn2Y 0aPBcMWzN7bTQ/1ugdDhZg7zhBDbiahziZr7cTm6n2Vvsbg/BdIlV7eabKksQOYmqMftKw/oQxNZR Nmgvirl5JVz7FGzhRsFsJFTWvJPSjEwopydzZBqIIcaeJsCQl8Xt5DR/n/fjzsR2hgUIcKPSC0AO9 pMPVIQACkZLRPeaHotueRGdDaOO6f57rxYkr4UnqCI17utx2IJszl0Qq00iQTK8QNaKPUj1PbIz1r VJozjDb6df2cxPsREDED1Mh096zzDPu3AqtWDdtbiCaU0HWPxLgB0uijeaWrEjUCC5/MH2IxP4ZQ3 cfpzYfkCptwi2XPWklRQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDqE-003xxK-Sr; Mon, 06 Dec 2021 13:15:38 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDpf-003wmB-82; Mon, 06 Dec 2021 13:15:04 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="237249126" X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="237249126" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:13:01 -0800 X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="604986568" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:12:50 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1muDmW-002mwh-84; Mon, 06 Dec 2021 15:11:48 +0200 Date: Mon, 6 Dec 2021 15:11:48 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Marc Zyngier , Matti Vaittinen , Sergio Paracuellos , Chunyan Zhang , Bartosz Golaszewski , Baruch Siach , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Tony Lindgren , Nicolas Saenz Julienne , Jianqun Xu , Alexandru Ardelean , Thierry Reding , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, bcm-kernel-feedback-list@broadcom.com, linux-power@fi.rohmeurope.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, Ray Jui , Florian Fainelli , Scott Branden , Gregory Fong , Eugeniy Paltsev , Keerthy , Orson Zhai , Baolin Wang , Chunyan Zhang , Vladimir Zapolskiy , Matthias Brugger , Thierry Reding , Lee Jones , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Manivannan Sadhasivam , Heiko Stuebner , Ludovic Desroches , Maxime Coquelin , Alexandre Torgue , Jonathan Hunter Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Message-ID: References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_051503_429979_C3F56117 X-CRM114-Status: GOOD ( 26.20 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote: > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko > wrote: > > > 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 these assignment all at once. > > > > For the details one may look into the of_gpio_dev_init() implementation. > > > > Signed-off-by: Andy Shevchenko > > This is definitely a patch in the right direction, as Bart says > it can be a bit dangerous, the outliers are those drivers that > assign the .dev to something completely different than the > the dev where the of_node is copied from. I carefully checked these all and this patch series is only for the cases when I'm sure it's the same device, which is used as parent, and its of_node supplied. > The idea was definitely always to only assign it in the core > *unless* there is a reason to have a completely different > of_node for some reason. > > > +++ b/drivers/gpio/gpio-rda.c > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev) > > rda_gpio->chip.label = dev_name(dev); > > rda_gpio->chip.ngpio = ngpios; > > rda_gpio->chip.base = -1; > > - rda_gpio->chip.parent = dev; > > - rda_gpio->chip.of_node = np; > > Mention in the commit message that in this driver > you also drop the the .parent assignment because the > core will handle it. Okay, I will update it. Also I'll update to the last codebase (dunno if Bart is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea ("gpio: bd70528 Drop BD70528 support"). -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22995C4332F for ; Mon, 6 Dec 2021 13:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7OhrXzeWOlSy0KElKAtT4KAjfHqt6qwf1CxGW0HXLtM=; b=z1lGvPjOwLadfk O5Du1KWs9ul2RvXhF5yXBCGevlCZ88k5O0HVrUW+IybzSc0XCClc5PRxhhhnUbjrLx24yPjgbed/C 9/w9xgP2IQeL6zxfv865KJ1vY5tTLSQ/bkxaSnpWzceVNInkcjgnvoR/2DkkPPvgZhlfyLztpEFx5 Y/QJhTZuYtP+FiAiIFAciQQzCfTCWdt1YJZC4Jn9xytsFryzazC+DayMR0nU2+CQ4xcJUdiIrsfRK FrqVWP9PFOc6heinbxt0d+GSv5dIqM5e5z5dUHbynlACZq3/XE9n6ZzfGHf/kpoPXdCi6a9pEJ+cy ikEXpDs/vAmNDldxOJdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDqB-003xvY-PA; Mon, 06 Dec 2021 13:15:35 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDpf-003wmB-82; Mon, 06 Dec 2021 13:15:04 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="237249126" X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="237249126" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:13:01 -0800 X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="604986568" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:12:50 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1muDmW-002mwh-84; Mon, 06 Dec 2021 15:11:48 +0200 Date: Mon, 6 Dec 2021 15:11:48 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Marc Zyngier , Matti Vaittinen , Sergio Paracuellos , Chunyan Zhang , Bartosz Golaszewski , Baruch Siach , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Tony Lindgren , Nicolas Saenz Julienne , Jianqun Xu , Alexandru Ardelean , Thierry Reding , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, bcm-kernel-feedback-list@broadcom.com, linux-power@fi.rohmeurope.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, Ray Jui , Florian Fainelli , Scott Branden , Gregory Fong , Eugeniy Paltsev , Keerthy , Orson Zhai , Baolin Wang , Chunyan Zhang , Vladimir Zapolskiy , Matthias Brugger , Thierry Reding , Lee Jones , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Manivannan Sadhasivam , Heiko Stuebner , Ludovic Desroches , Maxime Coquelin , Alexandre Torgue , Jonathan Hunter Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Message-ID: References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_051503_429979_C3F56117 X-CRM114-Status: GOOD ( 26.20 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote: > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko > wrote: > > > 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 these assignment all at once. > > > > For the details one may look into the of_gpio_dev_init() implementation. > > > > Signed-off-by: Andy Shevchenko > > This is definitely a patch in the right direction, as Bart says > it can be a bit dangerous, the outliers are those drivers that > assign the .dev to something completely different than the > the dev where the of_node is copied from. I carefully checked these all and this patch series is only for the cases when I'm sure it's the same device, which is used as parent, and its of_node supplied. > The idea was definitely always to only assign it in the core > *unless* there is a reason to have a completely different > of_node for some reason. > > > +++ b/drivers/gpio/gpio-rda.c > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev) > > rda_gpio->chip.label = dev_name(dev); > > rda_gpio->chip.ngpio = ngpios; > > rda_gpio->chip.base = -1; > > - rda_gpio->chip.parent = dev; > > - rda_gpio->chip.of_node = np; > > Mention in the commit message that in this driver > you also drop the the .parent assignment because the > core will handle it. Okay, I will update it. Also I'll update to the last codebase (dunno if Bart is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea ("gpio: bd70528 Drop BD70528 support"). -- With Best Regards, Andy Shevchenko _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2878C433EF for ; Mon, 6 Dec 2021 13:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b/Wuht5eXFrfRS2v7LrqpQilCHR+MnW/pi/ugmZCpGg=; b=utn+ahF9Z8VvMp SFRggilYffOa7GCH17zZftabcIHQ4LlJEgAr+8smpzTk4Ef5r1/UEl+eDf3PHHPWWXKEHh8betPQM HRGNDgyhfH+3RFlYWtJfZ/asrQbXxZD0rcHiAF2hziRvM1mQv7Nc+BAgACfEoQUCt5zssWKPd15hW dC/qEEVwFr6PgulFkNPXcy4PavFrgSkQLmzYe/jha/Ku4zNxYE788oUPtKRW9svIACsSG7+r2aRah SIg8IPEGZB7u71v97B6WYJtRkp/KQc91HGcoGdEyzQYZf7y69ylVoJIdz391GllgT1V09dUNXfBsJ Q2Q5aKh8GYOQxIV75Ihg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDpq-003xfa-1P; Mon, 06 Dec 2021 13:15:14 +0000 Received: from mga03.intel.com ([134.134.136.65]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1muDpf-003wmB-82; Mon, 06 Dec 2021 13:15:04 +0000 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="237249126" X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="237249126" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:13:01 -0800 X-IronPort-AV: E=Sophos;i="5.87,291,1631602800"; d="scan'208";a="604986568" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 05:12:50 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1muDmW-002mwh-84; Mon, 06 Dec 2021 15:11:48 +0200 Date: Mon, 6 Dec 2021 15:11:48 +0200 From: Andy Shevchenko To: Linus Walleij Cc: Marc Zyngier , Matti Vaittinen , Sergio Paracuellos , Chunyan Zhang , Bartosz Golaszewski , Baruch Siach , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Tony Lindgren , Nicolas Saenz Julienne , Jianqun Xu , Alexandru Ardelean , Thierry Reding , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, bcm-kernel-feedback-list@broadcom.com, linux-power@fi.rohmeurope.com, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, Ray Jui , Florian Fainelli , Scott Branden , Gregory Fong , Eugeniy Paltsev , Keerthy , Orson Zhai , Baolin Wang , Chunyan Zhang , Vladimir Zapolskiy , Matthias Brugger , Thierry Reding , Lee Jones , Grygorii Strashko , Santosh Shilimkar , Kevin Hilman , Robert Jarzmik , Manivannan Sadhasivam , Heiko Stuebner , Ludovic Desroches , Maxime Coquelin , Alexandre Torgue , Jonathan Hunter Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Message-ID: References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211206_051503_429979_C3F56117 X-CRM114-Status: GOOD ( 26.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote: > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko > wrote: > > > 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 these assignment all at once. > > > > For the details one may look into the of_gpio_dev_init() implementation. > > > > Signed-off-by: Andy Shevchenko > > This is definitely a patch in the right direction, as Bart says > it can be a bit dangerous, the outliers are those drivers that > assign the .dev to something completely different than the > the dev where the of_node is copied from. I carefully checked these all and this patch series is only for the cases when I'm sure it's the same device, which is used as parent, and its of_node supplied. > The idea was definitely always to only assign it in the core > *unless* there is a reason to have a completely different > of_node for some reason. > > > +++ b/drivers/gpio/gpio-rda.c > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev) > > rda_gpio->chip.label = dev_name(dev); > > rda_gpio->chip.ngpio = ngpios; > > rda_gpio->chip.base = -1; > > - rda_gpio->chip.parent = dev; > > - rda_gpio->chip.of_node = np; > > Mention in the commit message that in this driver > you also drop the the .parent assignment because the > core will handle it. Okay, I will update it. Also I'll update to the last codebase (dunno if Bart is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea ("gpio: bd70528 Drop BD70528 support"). -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel