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 3038CECAAA1 for ; Tue, 6 Sep 2022 00:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231421AbiIFATY (ORCPT ); Mon, 5 Sep 2022 20:19:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbiIFATX (ORCPT ); Mon, 5 Sep 2022 20:19:23 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56745C14; Mon, 5 Sep 2022 17:19:22 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id o126so782510pfb.6; Mon, 05 Sep 2022 17:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=fHHlrsomzS5RX1w3UIei5qFtxTClmy9iSQEvGb1yFamLQYZo+o6zDJ8zJUVbJLL82Y pkr7UJu0RGPOf+0J7r9ut0astM8MHGg1EaaL+qlGu/ue2aBOikrSmX+DoJq6OVnfYCTQ FMcozHAuaegI9kVFEFk5BCS8NUELgRVLurFlc4zQR+4mEluidRXNcvb1Uq6r9730CALq i+o2Z457eW9sgjxUmvKSOZs27VXpd+EYrVSuTXtKTDhoWiowlHQASX22DQpd3afScQaO NjyzcFcZoXy1i9cNJaiHRj8JaHrrDq+3JIoFmZc3azTXuJLuoblV3/wMiYnfYqdVD2x3 dUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=1+/5jNNCtN2Fcbg7pa+Qn/ASzRvEJrQL10qk+VIX4yxA73AmUf3kGFqwy67432klT+ xI8H0pD7o2ehXiLaGzu1EbGJDhLIOVJa+pgCjPROUcBeAn5O6xhx2lfpjdWBK6tjUp8X 96WY+LDvoHHWl1avLrqsFV79rW8Cdx2ZVmgmCEe852dzNaaKUUdfMH/bMfcPBeyibutS JVb2DPHW0NkXJq/hdYPVFDm0/oUWgZt+j9ceBnY/9sTXmfOib7HBi4/4WQci5KFVRK4f QCl8bdsvVAV2uvVTXbNAZKydZesxAdqYCx7hDCA5YCSMS3Fy5wneVBEhLblQISGolQeu d7+w== X-Gm-Message-State: ACgBeo18iFOHzHPbVoCq6ZcjBkFQfj/7YMbXiSussqZwsqA2g7flFT3a 8iaXhHR3W2O+9ens/wL9qkQ= X-Google-Smtp-Source: AA6agR6BSwkY2FCM/mxUqmLHetzPYwEnkn1n9g0P2sCyTVfQpw3+hUsDHc+Gpjiwldy8UpbPbUcIag== X-Received: by 2002:aa7:88c8:0:b0:536:926:700f with SMTP id k8-20020aa788c8000000b005360926700fmr53349294pff.72.1662423561657; Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id c10-20020a624e0a000000b0053e156e9475sm431528pfb.182.2022.09.05.17.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Date: Mon, 5 Sep 2022 17:19:17 -0700 From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 07/11] PCI: apple: switch to using fwnode_gpiod_get_index() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Sun, Sep 04, 2022 at 11:30:59PM -0700, Dmitry Torokhov wrote: > I would like to stop exporting OF-specific gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. > > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index a2c3c207a04b..d83817d3ff86 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -516,8 +516,8 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, > u32 stat, idx; > int ret, i; > > - reset = gpiod_get_from_of_node(np, "reset-gpios", 0, > - GPIOD_OUT_LOW, "PERST#"); > + reset = fwnode_gpiod_get_index(of_fwnode_handle(np), > + "reset", 0, GPIOD_OUT_LOW, "PERST#"); Hmm, I am looking at the driver and it leaks the reset gpio on unbind/unload. I guess it does not matter in practice, but still nice not to leak. Thankfully it is easy to cure by switching to devm option: devm_fwnode_gpiod_get(). I'll send and updated patch with a new justification. Thanks. -- Dmitry 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C71F9ECAAA1 for ; Tue, 6 Sep 2022 00:19:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74E9E10E50C; Tue, 6 Sep 2022 00:19:27 +0000 (UTC) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50E1210E50C for ; Tue, 6 Sep 2022 00:19:22 +0000 (UTC) Received: by mail-pf1-x42c.google.com with SMTP id 145so9797246pfw.4 for ; Mon, 05 Sep 2022 17:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=fHHlrsomzS5RX1w3UIei5qFtxTClmy9iSQEvGb1yFamLQYZo+o6zDJ8zJUVbJLL82Y pkr7UJu0RGPOf+0J7r9ut0astM8MHGg1EaaL+qlGu/ue2aBOikrSmX+DoJq6OVnfYCTQ FMcozHAuaegI9kVFEFk5BCS8NUELgRVLurFlc4zQR+4mEluidRXNcvb1Uq6r9730CALq i+o2Z457eW9sgjxUmvKSOZs27VXpd+EYrVSuTXtKTDhoWiowlHQASX22DQpd3afScQaO NjyzcFcZoXy1i9cNJaiHRj8JaHrrDq+3JIoFmZc3azTXuJLuoblV3/wMiYnfYqdVD2x3 dUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=6fEI2wnwHDuQQqWYdqu3rKY6mHxCnNlf2h0TniPllj1vGACgND1di/YtbE8uzcm2Hc zKVjMIS4Qqyf6/OhEEBaLBHXVf3YwH2O/PIhg0LuQHsXXxCsbE9ueDwoM1C7AXE2DYaR q3ejFEqt4ndgccxsE3yvKzQmZfZIEFsEvT6opmpx+g6MulXi3NAfa35jI2TBt4t2dGZt 5lAi19oYAJE0jgUx2i8StqHTvZgPeNiVxV63KDFsMbzMXtcF1636QBRDQDMDXPhK26tP 9V29I1yvMLV+JPXMeqOKqdl/DRajky7fXy9Fqpr0y+frotPEX4Kw4IjVe+cu8P2JNoZl bg/A== X-Gm-Message-State: ACgBeo3NWhHxk/c4UlpUwb+0u8+otRrvNKFdWmcnIYrGlZWXGuFzFvK2 4GDpA5t0pMrBnw4S/2eZTBkZdLmSDM4= X-Google-Smtp-Source: AA6agR6BSwkY2FCM/mxUqmLHetzPYwEnkn1n9g0P2sCyTVfQpw3+hUsDHc+Gpjiwldy8UpbPbUcIag== X-Received: by 2002:aa7:88c8:0:b0:536:926:700f with SMTP id k8-20020aa788c8000000b005360926700fmr53349294pff.72.1662423561657; Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id c10-20020a624e0a000000b0053e156e9475sm431528pfb.182.2022.09.05.17.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Date: Mon, 5 Sep 2022 17:19:17 -0700 From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH v1 07/11] PCI: apple: switch to using fwnode_gpiod_get_index() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-watchdog@vger.kernel.org, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Sun, Sep 04, 2022 at 11:30:59PM -0700, Dmitry Torokhov wrote: > I would like to stop exporting OF-specific gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. > > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index a2c3c207a04b..d83817d3ff86 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -516,8 +516,8 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, > u32 stat, idx; > int ret, i; > > - reset = gpiod_get_from_of_node(np, "reset-gpios", 0, > - GPIOD_OUT_LOW, "PERST#"); > + reset = fwnode_gpiod_get_index(of_fwnode_handle(np), > + "reset", 0, GPIOD_OUT_LOW, "PERST#"); Hmm, I am looking at the driver and it leaks the reset gpio on unbind/unload. I guess it does not matter in practice, but still nice not to leak. Thankfully it is easy to cure by switching to devm option: devm_fwnode_gpiod_get(). I'll send and updated patch with a new justification. Thanks. -- Dmitry 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 F1DECECAAA1 for ; Tue, 6 Sep 2022 00:20:22 +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=raf+1I3U8C93FSU4WW/l9/sfCtUhKKKmcFwaGi2KMl8=; b=Z75pLLVmQuJNdm chLuV4/R+0be7nTuIp9YIuj2BrtlulZHwCT43xF3V7XP2hGutRWyHA/X4UgYwax83+P4fAGzPqW7M 0yscFRdeO2HzOt7CtpRz4AMiUWkwkXZR8y0Nw3ztH/188ow8aUaM1HZnGMro2fHiDB+rOJTUnygMU zL7smpkpEYx4lA5kZs5cd4PDmqRkGgyqgzCGA+EfIK2malEAWa+RB9VIY+oJeWrjn6+STzlSXZEAM IDMwbdEO0Bm3kRcbHH+cMMKSjgEmF0TiPsRSJ8SmeO3Z0GODgDv54K3B3AOArQuO/nUFfb1/J9h9W NFndxxEsqOupOjkC2fGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVMJN-000fpz-0h; Tue, 06 Sep 2022 00:19:29 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVMJH-000fmm-Sj; Tue, 06 Sep 2022 00:19:25 +0000 Received: by mail-pf1-x434.google.com with SMTP id y136so4833193pfb.3; Mon, 05 Sep 2022 17:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=fHHlrsomzS5RX1w3UIei5qFtxTClmy9iSQEvGb1yFamLQYZo+o6zDJ8zJUVbJLL82Y pkr7UJu0RGPOf+0J7r9ut0astM8MHGg1EaaL+qlGu/ue2aBOikrSmX+DoJq6OVnfYCTQ FMcozHAuaegI9kVFEFk5BCS8NUELgRVLurFlc4zQR+4mEluidRXNcvb1Uq6r9730CALq i+o2Z457eW9sgjxUmvKSOZs27VXpd+EYrVSuTXtKTDhoWiowlHQASX22DQpd3afScQaO NjyzcFcZoXy1i9cNJaiHRj8JaHrrDq+3JIoFmZc3azTXuJLuoblV3/wMiYnfYqdVD2x3 dUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=0SlZFcEaoojArzRf0u/TXwqBOTogluJm54uUhdASJKYrwOoyYkLPKqudBKhXH0lWD5 dg2B6AzpUBqx0swHy9tMx1PFUKmdcyHwXH78/z7NPmAbvyoGiJq8zPTbd+IX+bN/nqQw ZOUCa2iRU7PCRYfu8cdVdL8TZLkDtacwqFwbImijPqRckiGiTk5oAkdQ1tNPbxB8gsLD Gzooa1Epgcninl9mhj9EQn1ZvGAIXOKGD0n+P6FpZluvljZtkj3nb3syXKqWmDSFS2j/ 7pwECJmnL7oLJ32BbB9G+OD0t6phLYA0KcFdUQd/eWpGOSryhulT6VJPVLlsrcrUZkoK iwHw== X-Gm-Message-State: ACgBeo3PYdnItXKDYHTLZ9vW6hbCzU1SJNrb5Es67WKTIQAfeguYnDW5 8Yd43BlTfk/GjOlGK2cG+qo= X-Google-Smtp-Source: AA6agR6BSwkY2FCM/mxUqmLHetzPYwEnkn1n9g0P2sCyTVfQpw3+hUsDHc+Gpjiwldy8UpbPbUcIag== X-Received: by 2002:aa7:88c8:0:b0:536:926:700f with SMTP id k8-20020aa788c8000000b005360926700fmr53349294pff.72.1662423561657; Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id c10-20020a624e0a000000b0053e156e9475sm431528pfb.182.2022.09.05.17.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Date: Mon, 5 Sep 2022 17:19:17 -0700 From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 07/11] PCI: apple: switch to using fwnode_gpiod_get_index() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_171923_988984_A01EC68D X-CRM114-Status: GOOD ( 18.16 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Sun, Sep 04, 2022 at 11:30:59PM -0700, Dmitry Torokhov wrote: > I would like to stop exporting OF-specific gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. > > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index a2c3c207a04b..d83817d3ff86 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -516,8 +516,8 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, > u32 stat, idx; > int ret, i; > > - reset = gpiod_get_from_of_node(np, "reset-gpios", 0, > - GPIOD_OUT_LOW, "PERST#"); > + reset = fwnode_gpiod_get_index(of_fwnode_handle(np), > + "reset", 0, GPIOD_OUT_LOW, "PERST#"); Hmm, I am looking at the driver and it leaks the reset gpio on unbind/unload. I guess it does not matter in practice, but still nice not to leak. Thankfully it is easy to cure by switching to devm option: devm_fwnode_gpiod_get(). I'll send and updated patch with a new justification. Thanks. -- Dmitry ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ 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 68FBAECAAD3 for ; Tue, 6 Sep 2022 00:20:59 +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=bd3QhVF/MtDgrMQDyGWaTjB+ObASExl6VdS7Fn7doOM=; b=pcXR3xvs09k3SQ R09H5gyIh8+xgzZUAoaaqvqX6LOutJzNQPy/6MyEcCUEQRHeFIbHcTyVfXCz4w2Jg6G2VNDvuQBNU i1Y78kJyooqW7rri59+WNUBGVFOFa8PLWbBAhNo8mHD4/Ku4M1x7X0mO5kSN6Ff0ki3fWOMDN3xDV VyE6ZT30oZiTAYosSyudvs9ea0nW1H0NleNnPkbvLpt+fe+nDPUIsw1hW4DiO1BZ1U1I+VKI6UUOm LcPNljw7QasCE9ZUZxZTzsfWn3eqpdz9j32STK4GNCAcRnl1AgRN1H4BN6rNywNAWnvNQE5wq3jVo CqbnlO9iwM6TA6bNhCRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVMJZ-000fu3-Bc; Tue, 06 Sep 2022 00:19:43 +0000 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVMJH-000fmm-Sj; Tue, 06 Sep 2022 00:19:25 +0000 Received: by mail-pf1-x434.google.com with SMTP id y136so4833193pfb.3; Mon, 05 Sep 2022 17:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=fHHlrsomzS5RX1w3UIei5qFtxTClmy9iSQEvGb1yFamLQYZo+o6zDJ8zJUVbJLL82Y pkr7UJu0RGPOf+0J7r9ut0astM8MHGg1EaaL+qlGu/ue2aBOikrSmX+DoJq6OVnfYCTQ FMcozHAuaegI9kVFEFk5BCS8NUELgRVLurFlc4zQR+4mEluidRXNcvb1Uq6r9730CALq i+o2Z457eW9sgjxUmvKSOZs27VXpd+EYrVSuTXtKTDhoWiowlHQASX22DQpd3afScQaO NjyzcFcZoXy1i9cNJaiHRj8JaHrrDq+3JIoFmZc3azTXuJLuoblV3/wMiYnfYqdVD2x3 dUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=v4JA0M0hCIbFC7NXFN+IygsKVK4ZMU4qWYqYqoR4tJc=; b=0SlZFcEaoojArzRf0u/TXwqBOTogluJm54uUhdASJKYrwOoyYkLPKqudBKhXH0lWD5 dg2B6AzpUBqx0swHy9tMx1PFUKmdcyHwXH78/z7NPmAbvyoGiJq8zPTbd+IX+bN/nqQw ZOUCa2iRU7PCRYfu8cdVdL8TZLkDtacwqFwbImijPqRckiGiTk5oAkdQ1tNPbxB8gsLD Gzooa1Epgcninl9mhj9EQn1ZvGAIXOKGD0n+P6FpZluvljZtkj3nb3syXKqWmDSFS2j/ 7pwECJmnL7oLJ32BbB9G+OD0t6phLYA0KcFdUQd/eWpGOSryhulT6VJPVLlsrcrUZkoK iwHw== X-Gm-Message-State: ACgBeo3PYdnItXKDYHTLZ9vW6hbCzU1SJNrb5Es67WKTIQAfeguYnDW5 8Yd43BlTfk/GjOlGK2cG+qo= X-Google-Smtp-Source: AA6agR6BSwkY2FCM/mxUqmLHetzPYwEnkn1n9g0P2sCyTVfQpw3+hUsDHc+Gpjiwldy8UpbPbUcIag== X-Received: by 2002:aa7:88c8:0:b0:536:926:700f with SMTP id k8-20020aa788c8000000b005360926700fmr53349294pff.72.1662423561657; Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id c10-20020a624e0a000000b0053e156e9475sm431528pfb.182.2022.09.05.17.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 17:19:21 -0700 (PDT) Date: Mon, 5 Sep 2022 17:19:17 -0700 From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 07/11] PCI: apple: switch to using fwnode_gpiod_get_index() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_171923_988984_A01EC68D X-CRM114-Status: GOOD ( 18.16 ) 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, Sep 04, 2022 at 11:30:59PM -0700, Dmitry Torokhov wrote: > I would like to stop exporting OF-specific gpiod_get_from_of_node() > so that gpiolib can be cleaned a bit, so let's switch to the generic > fwnode property API. > > Signed-off-by: Dmitry Torokhov > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index a2c3c207a04b..d83817d3ff86 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -516,8 +516,8 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, > u32 stat, idx; > int ret, i; > > - reset = gpiod_get_from_of_node(np, "reset-gpios", 0, > - GPIOD_OUT_LOW, "PERST#"); > + reset = fwnode_gpiod_get_index(of_fwnode_handle(np), > + "reset", 0, GPIOD_OUT_LOW, "PERST#"); Hmm, I am looking at the driver and it leaks the reset gpio on unbind/unload. I guess it does not matter in practice, but still nice not to leak. Thankfully it is easy to cure by switching to devm option: devm_fwnode_gpiod_get(). I'll send and updated patch with a new justification. Thanks. -- Dmitry _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel