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 73D35EB8FDE for ; Wed, 6 Sep 2023 14:47:54 +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=bWS4JPjfdj7SvOtZbQ7iHUMf339j3pm0Yom6oUBoRdk=; b=OP45EmClcUrVTb xUKgIttZ0bT+yy4olgEMKzafxfgtgrONDLEzxpRuMcn4svQU9s7TP80XAhunlcyTjuQr8KJUrY9vw Qh9JuPSgYKMp0luwOeew9OA6ATDVnd9zpA8Nd2+5lX3ZfEHG++0aPea8L0bURouuNlwZAfXj3UoXu yMrorRnGDh5V4sovYcb8XT9QCjMsMOkcc2E4mQqWEMVvkomKoHmW4zRS3xw9YeQlWKnUvxPXAzW9m ILh3DTFRKWbaiNjxvAo/5vp6icLEiK07oua5R2tXI5wELayQyPbvOvLZk7FijPY7JXo4Zf/iWml6z QHGjqluMepQHZLsDNLpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdtoR-00AJJf-1o; Wed, 06 Sep 2023 14:47:23 +0000 Received: from mgamail.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdtoP-00AJIr-0E for linux-arm-kernel@lists.infradead.org; Wed, 06 Sep 2023 14:47:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694011641; x=1725547641; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=+wfY4dLBSqJqYH1eCxjcFAXhA4C/3J/082gICwAh3j0=; b=ghK7etziZqPENMCNQvwzCS7ygAOgdueW+tE38+Ww6ksvDkA4qr5BpEhc OBu9qxG4lVgsYl31tAU5j2fEv/Qee3UXEUmX8EWFfEP34EhmmC9nrzCwS kjTCf+ROOrc2zkByGx49ivz5NWiJaRe0BCoOFyv+5IucD4JiB9neSQS5t PP9X5LLbDbV+31IlXGNwfSPZrZkkGNx0cHQuQBIkkDulGRC9YsK2ut3ux d/lcyKoQBsLWYLh/87LCdCHBzIcNROzqv1Rm5+KnfsS35y75hp1u7k21g 1qg/kJ1IQlF5ZGvjrJLV+/QzC0aYoxQ/ZWySObnynBJm8WaO9hvblY8z9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="408088691" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="408088691" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 07:47:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10825"; a="856460670" X-IronPort-AV: E=Sophos;i="6.02,232,1688454000"; d="scan'208";a="856460670" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2023 07:47:04 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qdto5-006y0f-0Q; Wed, 06 Sep 2023 17:47:01 +0300 Date: Wed, 6 Sep 2023 17:47:00 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Mika Westerberg , 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: [RFT PATCH 14/21] hte: tegra194: don't access struct gpio_chip Message-ID: References: <20230905185309.131295-1-brgl@bgdev.pl> <20230905185309.131295-15-brgl@bgdev.pl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230905185309.131295-15-brgl@bgdev.pl> 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-20230906_074721_126079_51800F8D X-CRM114-Status: GOOD ( 17.00 ) 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 Tue, Sep 05, 2023 at 08:53:02PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Using struct gpio_chip is not safe as it will disappear if the > underlying driver is unbound for any reason. Switch to using reference > counted struct gpio_device and its dedicated accessors. ... > + struct gpio_device *gdev __free(gpio_device_put) = NULL; Using this requires cleanup.h to be included. Does any of the included GPIO headers guarantee that inclusion implicitly? Even though, it's a good practice to include headers of what we are using independently if other (library) headers include them. I.o.w. we can rely only on our headers (here HTE framework related) to guarantee any inclusions implicitly. This also applies to other users of the same construct. ... > static int tegra_gpiochip_match(struct gpio_chip *chip, void *data) > { > return chip->fwnode == of_node_to_fwnode(data); > } Not sure how many users of this kind of match, but it might be useful to have it by GPIO library gpio_device_find_by_fwnode() -- 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