Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2600100rdh; Wed, 27 Sep 2023 07:23:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDpwcF8QILcd5wh4PQ113CrBsa5YwhkO+1jQ6wDglpyTmTY1ZqcsTZDa1fMus9YsFX4aYP X-Received: by 2002:a05:6a20:ce92:b0:15d:bd4d:2305 with SMTP id if18-20020a056a20ce9200b0015dbd4d2305mr2170673pzb.27.1695824612395; Wed, 27 Sep 2023 07:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695824612; cv=none; d=google.com; s=arc-20160816; b=FWz6vUPLFKQCc7jWZJz3n1uMSBcD2RsOd12HazlV23STpIxKJeUKECFR3tyJeIRBYM n2Z2TfiRM3y0mGXWO9yQUoeH/LqDMn0xAGxviNSsti+WAT1VqQXRIHOcerVQ8IGaTC8/ MoDZngTG+ndhw/AZ7H6duM24/+cqijJH1iQ70ARiHFgmxVnZYR8VOMklZI9Ah3t4gQ16 FpQ5RvyzhWqHyFn+pFTcdA5c1UlYKVx7ZcN7DelEodhsChDMiUgE4dV2TwRxWvd4wqKe amPy5zgYYFvJVDSta6crMvjRwzKg7r2OJuQMPtw6XIeC+I/NaTzkkhGMfX4qpgayhmDw 951Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nI111aFn1RtqnIwx2cmQfOHYiCzvAruXnLT26VvUQzI=; fh=dlWaF0ouAk38l6ZadWZzGtL4PI4M8Q/efUW65rhq1u0=; b=d2I/XumsBqbr4MqjkbF4Zla8qIcWZNaOiXjivaK/i/rxc3PKxhCd9aFB4TtgN8j8l5 pqsPByTFiVCZonqj7TPMeLu0m9m0GpidY8NCuwdsFmF9nJVEHVQzf2AKh/2g3syOVdS/ AuoXAZDUDsT/d9ex2g6pPDV/cL5yf44Sxy9JAX76Ig/dU8mofWDeC7S1tCmtPKUdH7Hh PVef4rYX3C29neohPAURGl3Pyay77bWbbfkywyu7c74nzgsJJWY0ffS7sOqSyMY6Gs/B 4efrGsC/B4nu1WOySfo12gqbkOCukDOLI+UPweIS9D68sagN9DpvMD8BP599NU9gElf5 bEBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id br4-20020a056a00440400b0068feb1cf986si15257811pfb.241.2023.09.27.07.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 07:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F0873829F995; Wed, 27 Sep 2023 06:47:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231962AbjI0Nqz (ORCPT + 99 others); Wed, 27 Sep 2023 09:46:55 -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 X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 27 Sep 2023 06:47:16 -0700 (PDT) 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