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 9F03ECA0ED2 for ; Mon, 11 Sep 2023 21:27:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242888AbjIKVSb (ORCPT ); Mon, 11 Sep 2023 17:18:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237534AbjIKM4w (ORCPT ); Mon, 11 Sep 2023 08:56:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BE4FCD7; Mon, 11 Sep 2023 05:56:48 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="375425742" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="375425742" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:56:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10830"; a="772577626" X-IronPort-AV: E=Sophos;i="6.02,244,1688454000"; d="scan'208";a="772577626" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2023 05:56:45 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qfgT4-008KW5-2E; Mon, 11 Sep 2023 15:56:42 +0300 Date: Mon, 11 Sep 2023 15:56:42 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Mika Westerberg , Linus Walleij , platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH 6/8] platform/x86: x86-android-tablets: Stop using gpiolib private APIs Message-ID: References: <20230909141816.58358-1-hdegoede@redhat.com> <20230909141816.58358-7-hdegoede@redhat.com> 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-acpi@vger.kernel.org On Mon, Sep 11, 2023 at 02:49:44PM +0200, Bartosz Golaszewski wrote: > On Sun, Sep 10, 2023 at 1:26 PM Hans de Goede wrote: > > On 9/10/23 10:24, Andy Shevchenko wrote: > > > On Sat, Sep 9, 2023 at 5:18 PM Hans de Goede wrote: ... > > >> + gpiod = devm_gpiod_get(&x86_android_tablet_device->dev, con_id, dflags); ^^^ > > >> - *desc = gpiod; > > >> + if (desc) > > >> + *desc = gpiod; > > > > > > Are we expecting that callers may not want the GPIO descriptor out of > > > this function? > > > Sounds a bit weird if so. > > > > Yes specifically the Charge-enable and OTG (Vboost enable) pins on the > > bq25892 charger on the Lenovo Yoga Tab 3 just need to be set to a fixed > > value, so we request the pins with GPIOD_OUT_LOW / _HIGH and then > > leave them at that value. > > You mean you leak the descriptor? It would warrant either a comment or > storing the descriptor somewhere and cleaning it up if the device can > be unbound (I guess it can since the driver can be built as module). Note devm_*() above. -- With Best Regards, Andy Shevchenko