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 8CA6FEB8FAD for ; Wed, 6 Sep 2023 07:11:07 +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=TizD2/GbeP7kBVHuOpAj/dRgxE4jxYyS5QOeDOnadFM=; b=FoOtZjvY/D70mS i0bOvY3Ro3QrHZLfSL11gQqC7ii3E40XYLPMtUjMk4rvf7kX2CZkqgF7oUgu+ZkhDg22ReQVcKz/7 XKKnHkTiOkBGYpy60xfL4X8iYmlL3Ktg4LiIm26NrtzmHRCuTPrmbLvJX/I2FaVy854UREbReZsfO 0SNxm81xwd8i8bRnqHvHz1F5qDIdVMUjMd25qQoGUxz8D6wD4IPLY0gYALbtwN7zPQuFmSWX7GNqV ex35971XDAS/CQaahGeBv7pPvYKGosqmCoFb2Ih9z+sOyZt7vjevdFhM8ETMq/bogntaqh7fMLgxi +T+wGiukHr3EkUL5oumA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdmgV-007S38-2c; Wed, 06 Sep 2023 07:10:43 +0000 Received: from mgamail.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdmgS-007S2U-2v for linux-arm-kernel@lists.infradead.org; Wed, 06 Sep 2023 07:10:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1693984240; x=1725520240; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CzVsvBBCQyE6nmVgfBDTPc4IJEBFPNuhlR6CIA56RSY=; b=jh/OGLjnnh+SnvwGZL7DuwN60omR4cuAf2PX0vJQ7p/CET3lBGgpZJR5 7rjsb1HNryP1TBaRL/jk98Y422kNMsKrOVWp7KOOZosizmmytsIDyYmxf UQqbe0mltBJ4CM564EqEsMh/4fubF0TZ//RsrvAFbfgjKcdz6h9N0R/an F+lCVtfGBuzhnmh6DLJ/3+26qxG9Jx7cjiK4hSrVR9l2C+C3lY/wmowZb HuzC2ExpL/6BzIntGnhIca6vkn6qCvVoaU9XJTDTIrgVzcYKik44HxU+B vA0UOJgeBpPVy7bFaVQmyIT9RYibrXr1qW++ahSFmQ5ksD3eYTVpfLkRC g==; X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="407993431" X-IronPort-AV: E=Sophos;i="6.02,231,1688454000"; d="scan'208";a="407993431" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 00:10:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10824"; a="734933655" X-IronPort-AV: E=Sophos;i="6.02,231,1688454000"; d="scan'208";a="734933655" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 06 Sep 2023 00:10:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id 1DF7F30D; Wed, 6 Sep 2023 10:10:32 +0300 (EEST) Date: Wed, 6 Sep 2023 10:10:32 +0300 From: Mika Westerberg To: Bartosz Golaszewski Cc: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Andy Shevchenko , Linus Walleij , Dipen Patel , Thierry Reding , Jonathan Hunter , Hans de Goede , Mark Gross , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 08/21] gpio: acpi: provide acpi_gpio_device_free_interrupts() Message-ID: <20230906071032.GA1599918@black.fi.intel.com> References: <20230905185309.131295-1-brgl@bgdev.pl> <20230905185309.131295-9-brgl@bgdev.pl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230905185309.131295-9-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230906_001040_991200_25BF2BB0 X-CRM114-Status: GOOD ( 26.30 ) 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 Hi, On Tue, Sep 05, 2023 at 08:52:56PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > We're moving away from public functions that take struct gpio_chip as > argument as the chip - unlike struct gpio_device - is owned by its > provider and tied to its lifetime. > > Provide an alternative to acpi_gpiochip_free_interrupts(). Looks good to me, few minor comments below. > > Signed-off-by: Bartosz Golaszewski Reviewed-by: Mika Westerberg > --- > drivers/gpio/gpiolib-acpi.c | 29 +++++++++++++++++++++++------ > include/linux/gpio/driver.h | 12 ++++++++++++ > 2 files changed, 35 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c > index fbda452fb4d6..5633e39396bc 100644 > --- a/drivers/gpio/gpiolib-acpi.c > +++ b/drivers/gpio/gpiolib-acpi.c > @@ -558,12 +558,9 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) > } > EXPORT_SYMBOL_GPL(acpi_gpiochip_request_interrupts); > > -/** > - * acpi_gpiochip_free_interrupts() - Free GPIO ACPI event interrupts. > - * @chip: GPIO chip > - * > - * Free interrupts associated with GPIO ACPI event method for the given > - * GPIO chip. > +/* > + * This function is deprecated, use acpi_gpio_device_free_interrupts() > + * instead. > */ > void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) > { > @@ -604,6 +601,26 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) > } > EXPORT_SYMBOL_GPL(acpi_gpiochip_free_interrupts); > > +/** > + * acpi_gpio_device_free_interrupts() - Free GPIO ACPI event interrupts. > + * @chip GPIO device Should be: @chip: GPIO device > + * > + * Free interrupts associated with GPIO ACPI event method for the given > + * GPIO device. > + */ > +void acpi_gpio_device_free_interrupts(struct gpio_device *gdev) > +{ > + struct gpio_chip *gc; > + > + /* TODO: protect gdev->chip once SRCU is in place in GPIOLIB. */ > + gc = gdev->chip; > + if (!gc) > + return; > + > + acpi_gpiochip_free_interrupts(gc); > +} > +EXPORT_SYMBOL_GPL(acpi_gpio_device_free_interrupts); > + > int acpi_dev_add_driver_gpios(struct acpi_device *adev, > const struct acpi_gpio_mapping *gpios) > { > diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h > index b68b3493b29d..47906bc56b3d 100644 > --- a/include/linux/gpio/driver.h > +++ b/include/linux/gpio/driver.h > @@ -835,4 +835,16 @@ static inline struct fwnode_handle *gpiochip_node_get_first(struct device *dev) > return NULL; > } > > +/* > + * FIXME: Remove this once the only driver that uses it - android tablets - > + * becomes a good citizen and stops abusing GPIOLIB. There are a acouple of more when grepping for acpi_gpiochip_free_interrupts(). I'm not entirely sure why these functions are exposed to the drivers in the first place. IMHO GPIOLIB should deal with these but perhaps there is some good reason these drivers do it... > + */ > +#ifdef CONFIG_ACPI > +void acpi_gpio_device_free_interrupts(struct gpio_device *gdev); > +#else > +static inline void acpi_gpio_device_free_interrupts(struct gpio_device *gdev) > +{ > +} I would put these {} to the same line: static inline void acpi_gpio_device_free_interrupts(struct gpio_device *gdev) { } > +#endif > + > #endif /* __LINUX_GPIO_DRIVER_H */ > -- > 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel