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 AADFBC433EF for ; Sun, 5 Dec 2021 00:06:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbhLEAJz (ORCPT ); Sat, 4 Dec 2021 19:09:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbhLEAJp (ORCPT ); Sat, 4 Dec 2021 19:09:45 -0500 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B908C0611F7 for ; Sat, 4 Dec 2021 16:06:19 -0800 (PST) Received: by mail-oi1-x231.google.com with SMTP id r26so13796055oiw.5 for ; Sat, 04 Dec 2021 16:06:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aLM7Vzy6+wcFi2+uw4mY6eHdc1c6QIPZ2YzBFSeQVDk=; b=oypqQM9WYczOUD8yOv4W0b0J4SdrSIP2/GWFE4TR5k1CGEkHNy9WPiO008zNzsg3Pz zh9bUtf/VG6/b3zJ480BiJtwEa7PuEjsHQIWuEsggMdMqcZfJwsOE3iFtiG2DEPADAsO hqFPrgRv7CWtgQ4J5ZJRkR9iA1oQHlUoWYY8QDKpr7VM+f+8Yrryge0w8oCSslRvNp+6 exKWbX0iHLd50+WQaM9fAnPeBnEozwwfUcCOKBUJC5pSMVg0d33S/UEK3rrGtAaDpFWu Uv4am7V67+qDJ2gKBQwHEmdYiUOqE7eMf4wLG94y+RQ3YPpVsZKN31tRHAbmVgDqfwLj frKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aLM7Vzy6+wcFi2+uw4mY6eHdc1c6QIPZ2YzBFSeQVDk=; b=dJK5aLt6MLOaqq8R38c829HmuuhsEVcaMaGidu6Dz18qFj8nBqVqbB7I0eQ7hN2EuN GZBZoU8rL8q5aEFEC2qObDfVTLjvZN7T1ongA6XR2OZ4mbB84N3PRQbBkncVdH+VRvDj fZAxH0syeUzzu/1BLx3M9GuRLTMbguCmabj/OXDdQDI9UkIj68nU49ncW13K0UwTFJ7c Ff+9pt6eRVuJHAIcYb1H6e52SFfsWoiRaAtcW6Pr0dM/XIsxKh6lYjSpr14dcHq1GLiR SundPpuJFiy1H4YIYhvEr6MG0bwmDMO5hXq6J/YXv4V2eSS5FQl/zajH7IRLRjiJAGhs 3xrw== X-Gm-Message-State: AOAM533SmCecjeOZ2CZMXmOHZnQc5B+VDN5n9YT5+KePig/BI/AqdKpD jSvY6ANut8+Oq7sHxiNrjHB+xt7TOf567peNxp6iAw== X-Google-Smtp-Source: ABdhPJy/aeGs123LiAIPsyMW3EdsawUgHdqxl5iex8vMswm1x7JAmAebxj9z1jBeNmQdoS/RXvDPX+AOcq/DNJTtHIA= X-Received: by 2002:aca:120f:: with SMTP id 15mr16602417ois.132.1638662778472; Sat, 04 Dec 2021 16:06:18 -0800 (PST) MIME-Version: 1.0 References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> In-Reply-To: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com> From: Linus Walleij Date: Sun, 5 Dec 2021 01:06:07 +0100 Message-ID: Subject: Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers To: Andy Shevchenko Cc: Marc Zyngier , Matti Vaittinen , Sergio Paracuellos , Chunyan Zhang , Bartosz Golaszewski , Baruch Siach , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Yours, Linus Walleij