Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2388155ybl; Mon, 20 Jan 2020 01:55:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyDlIdhhAPb6wGtq2momD+JhKdbra5d2xwedRWwIoMsd2XWm7yGbFBzAMKdE6gj7h55ax80 X-Received: by 2002:a9d:674f:: with SMTP id w15mr15544557otm.243.1579514138858; Mon, 20 Jan 2020 01:55:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579514138; cv=none; d=google.com; s=arc-20160816; b=RXF3Wh0P2GTDLyay9J7ki7uTna06x05C94cuM6iD36mVv2efIlMYBBQhUn9qHj+kNL AKB5Ar8NjdxXrmpxyb+Gxkus3pgOM5AZwKEP9IJDSLSYUhGMddBHez5Web7fGD7Hpaxf CXogj0wRgE6HwSqY1Xkl6d6nP+K8ETYUoFpKiE+K00o9kwi/ZTz4D2sUNDGEuZFIBeQ2 WmvMAcMaOYxN79/34dyCjyqdNKfhohM3B3Vad46Zw3eSLTg+r55NQz/7AWTkXaQADX7a 2pWB2vMyUB9jl+pmBOXMJXfivGMVaZ45yN7EFF5pGfwx12IF/e1hq4Jk9MIS2XIZh7+7 BnHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hcUNdo6dE5CHX9WW2lGRaAAJTEwNWiH7ZJQJwDYVP4s=; b=sb+qwJzLW7OysO1MQd2uX9pMolzTds+P5VoAdCoccMRIwC4XhLxLAJm5ugbIy3hCdT s/Srf6QRbOsrbZP50bpRry2ENWDdS4ZxG3sAt4SXS3afq8Yv4iW/GC+e4wWaNCIfZnal z8yvRAF0mKHFx137O+aUYl9HgRSv4TMrluIWy0vhwv/m9u8AuacG+6t9YOILd7NX5B9P fn9/nkjdx9zIzthRuuTSd+kzYZ7Nk/YLKAFjX5EgHe+RRIPVUnzGSXPBV5Dgu3D+XBPn vBkKbSrtVa1Jjj3VIN2UcpiVYrXbF6/GVIdWPy8ox/w107QXHrwIpae9bJbykqA4tte9 ouJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v67si18763705oia.26.2020.01.20.01.55.26; Mon, 20 Jan 2020 01:55:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgATJya (ORCPT + 99 others); Mon, 20 Jan 2020 04:54:30 -0500 Received: from mga11.intel.com ([192.55.52.93]:60863 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgATJy3 (ORCPT ); Mon, 20 Jan 2020 04:54:29 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jan 2020 01:54:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,341,1574150400"; d="scan'208";a="274969721" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by FMSMGA003.fm.intel.com with ESMTP; 20 Jan 2020 01:54:26 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1itTlL-0008P3-Qm; Mon, 20 Jan 2020 11:54:27 +0200 Date: Mon, 20 Jan 2020 11:54:27 +0200 From: Andy Shevchenko To: Geert Uytterhoeven Cc: Bartosz Golaszewski , Kent Gibson , Linus Walleij , Greg Kroah-Hartman , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Bartosz Golaszewski Subject: Re: [PATCH v4 02/13] gpiolib: have a single place of calling set_config() Message-ID: <20200120095427.GE32742@smile.fi.intel.com> References: <20191224120709.18247-1-brgl@bgdev.pl> <20191224120709.18247-3-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2020 at 09:44:43AM +0100, Geert Uytterhoeven wrote: > On Tue, Dec 24, 2019 at 1:08 PM Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Instead of calling the gpiochip's set_config() callback directly and > > checking its existence every time - just add a new routine that performs > > this check internally. Call it in gpio_set_config() and > > gpiod_set_transitory(). Also call it in gpiod_set_debounce() and drop > > the check for chip->set() as it's irrelevant to this config option. ... > > config = PIN_CONF_PACKED(mode, arg); > > - return gc->set_config ? gc->set_config(gc, offset, config) : -ENOTSUPP; > > + return gpio_do_set_config(gc, offset, mode); > > These two lines are not equivalent: the new code no longer uses the > packed value of mode and arg! Good catch! It's a regression (pin control drivers expects arg to be 1 in case it has been called thru GPIO framework to set "default" values in terms of certain driver) and below mentioned commits must be reverted. This one seems has a typo which must be fixed. > Hence this leads to subsequent cleanups in commits e5e42ad224a040f9 > ("gpiolib: remove set but not used variable 'config'") and d18fddff061d2796 > ("gpiolib: Remove duplicated function gpio_do_set_config()"). > However, what was the purpose of the PIN_CONF_PACKED() translation? > Why is it no longer needed? -- With Best Regards, Andy Shevchenko