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 550EEE784AF for ; Mon, 2 Oct 2023 09:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236408AbjJBJ7B (ORCPT ); Mon, 2 Oct 2023 05:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236406AbjJBJ6q (ORCPT ); Mon, 2 Oct 2023 05:58:46 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4A21704; Mon, 2 Oct 2023 02:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696240703; x=1727776703; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=keZzMkcN0PISim8T5Z34Kx47RiqtJkzIs5J68O3vTQw=; b=J6anhFzYr6GLXhEzUkJIWWOJBgD01V/x3LX55iImTkRVrOrUohYWYBhi 36JDhtMWYI04PuNaq1CR9N+hWFCxtrLBiQfwZ+hTt9wlTgxwdIF58/lS8 kXTunY6P7D0zIR5XYTFRVbIzcoLG6uBPz2fMkkL54Ya/OqCGjVrK7m2jO rwWoXY3nH0Neb1P14gfdh6gPgFSY29AT2LH3EBoE0ifIv2V4x89PDnYBh kDb+P6v2Ibd6x6Sbq2C93rCM2IyCI+a/wdpzn1DQpUq0Chr3k25+ZHygd w2q5jci1anT5QEmmku32kDozYR2AkLcM9EK89QERd57Vk+QbwVKVNmew4 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="382518536" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="382518536" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:58:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10850"; a="1081595040" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="1081595040" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 02:58:20 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qnFgv-000000027pr-25Ck; Mon, 02 Oct 2023 12:58:17 +0300 Date: Mon, 2 Oct 2023 12:58:17 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v4 05/11] gpiolib: provide gpio_device_get_desc() Message-ID: References: <20230927142931.19798-1-brgl@bgdev.pl> <20230927142931.19798-6-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Oct 02, 2023 at 11:54:40AM +0200, Bartosz Golaszewski wrote: > On Mon, Oct 2, 2023 at 11:46 AM Andy Shevchenko > wrote: > > On Wed, Sep 27, 2023 at 04:29:25PM +0200, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > > > Getting the GPIO descriptor directly from the gpio_chip struct is > > > dangerous as we don't take the reference to the underlying GPIO device. > > > In order to start working towards removing gpiochip_get_desc(), let's > > > provide a safer variant that works with an existing reference to struct > > > gpio_device. ... > > > +EXPORT_SYMBOL_GPL(gpiochip_get_desc); > > > > > +struct gpio_desc * > > > +gpio_device_get_desc(struct gpio_device *gdev, unsigned int hwnum) > > > > I'm wondering if you move this to be upper than gpiochip_get_desc() and > > diff will look better... > > There's a limit to bikeshedding in my book and "making the diff look > better" is definitely it. :) Right, but if you are going to send a new version it might makes sense to try, no? -- With Best Regards, Andy Shevchenko