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 8D90BE810DA for ; Wed, 27 Sep 2023 13:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231979AbjI0Nq4 (ORCPT ); Wed, 27 Sep 2023 09:46:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbjI0Nqy (ORCPT ); Wed, 27 Sep 2023 09:46:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A52121; Wed, 27 Sep 2023 06:46:53 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="412740175" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="412740175" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 06:46:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="752601458" X-IronPort-AV: E=Sophos;i="6.03,181,1694761200"; d="scan'208";a="752601458" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga007.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 06:46:48 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qlUsH-00000000ttl-0fli; Wed, 27 Sep 2023 16:46:45 +0300 Date: Wed, 27 Sep 2023 16:46:44 +0300 From: Andy Shevchenko To: Duje =?utf-8?Q?Mihanovi=C4=87?= Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Bartosz Golaszewski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH RFC v2 3/6] ARM: pxa: Convert Spitz CF power control to GPIO descriptors Message-ID: References: <20230926-pxa-gpio-v2-0-984464d165dd@skole.hr> <20230926-pxa-gpio-v2-3-984464d165dd@skole.hr> <5984688.lOV4Wx5bFT@radijator> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5984688.lOV4Wx5bFT@radijator> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 27, 2023 at 02:56:07PM +0200, Duje Mihanović wrote: > On Tuesday, September 26, 2023 6:15:37 PM CEST Andy Shevchenko wrote: > > On Tue, Sep 26, 2023 at 05:46:24PM +0200, Duje Mihanović wrote: ... > > > + cf_power = gpiod_get(&pxa_device_mci.dev, "cf_power", GPIOD_ASIS); > > > + if (IS_ERR(cf_power)) { > > > + dev_err(&pxa_device_mci.dev, > > > + "failed to get power control GPIO with > %ld\n", > > > + PTR_ERR(cf_power)); > > > + return; > > > + } > > > > > > + gpiod_put(cf_power); > > > > Don't you want to use guarded gpiod_get()? > > Okay, it seems not yet in the pending list, but we can survive without that. > > Can you please elaborate? If I understand correctly, the if statement right > after gpiod_get is a guard. It's about RAII version of the gpiod_get(). It's quite a new thing in the Linux kernel. -- With Best Regards, Andy Shevchenko