Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1894710rdb; Tue, 3 Oct 2023 04:39:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEN+ZW6L1et9fzNZHfeT6pYMhlvBzFG1BIBnO1bfhXLprAtUs4p1h3I1/hXMc/chBXvOxwP X-Received: by 2002:a17:90a:2f61:b0:279:13c3:6b21 with SMTP id s88-20020a17090a2f6100b0027913c36b21mr11574464pjd.9.1696333191271; Tue, 03 Oct 2023 04:39:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696333191; cv=none; d=google.com; s=arc-20160816; b=zLh6uu0GAsNzwNLXzsv+UKC1TXOOxAUaHSnPLFRWkM4BLmlVKLSbV8aqAcrAsx/+e3 Ef6bRDbjSjR+9RtI+NDLCdqo7GIQXpQ514yM3vr0KoXwsEQNWdLSvy/76Nk+k3t3dkd+ +juq5WSoaR/3y6yd0DJrDMWKDxhWizPvC4DGricSffRmu3e2rxfBP0Qi+FwBziTtBV5H JZ6+/Cg7aDg/NiBnIEz97HzJ+e2U8j8H4GOPFJIE0SbU0v025qYgR5uHVbjGKgyM1w8X N6V9vP65I7ESVPPNseyBGMLdoZNxLCEdwr2u0M9Xk9qQ33MVzZSQYzsmGQHWQPZn21Tg rUQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=kKBDfEdMScFcAuwDpyffQFKC/EUrt05ORh8xaLZ4kMs=; fh=xmpzKFUF9RqL2V/UGANKuip29GmDhRsCbnyKSfa8VlE=; b=tiso4JQw+ZmC+hZBT7F2/G2QJlzNVNHFRcPwEe8tMTNe7z2mbMlDNuFsF9d8fRErNx EpeFJTtp0OVDok/of5MuE6SXPSHyHGxjYa98icMog0aM7CrLcqqfc1bKM7Jm0D2tZ4Q3 ugg4IxItrkOlc7idKLpJIzFD421a2U14lf1W26WUdKUHnb63HWrXy93A+HEh3b3FbJMW iApusLPno6vqvBqG6WAgAh2vk52J/h0FPzDFszywlWVCJJAfvUW44b19veSVl4PrgT02 ytltw4WGaodz5xu0sKx/dH3Rb6fOXGZZ86d+4e+WFZwcbLlPSIUQ4bVxOypPpVZFHa+O 1MdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=STTPjkZ1; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jdvYjG2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id pg5-20020a17090b1e0500b0025bdaaf0d17si1360164pjb.33.2023.10.03.04.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 04:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=STTPjkZ1; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=jdvYjG2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 949A281896DE; Tue, 3 Oct 2023 04:39:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240603AbjJCLjs (ORCPT + 99 others); Tue, 3 Oct 2023 07:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbjJCLjq (ORCPT ); Tue, 3 Oct 2023 07:39:46 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D57EC4; Tue, 3 Oct 2023 04:39:42 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9AB853200B1A; Tue, 3 Oct 2023 07:39:37 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 03 Oct 2023 07:39:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1696333177; x=1696419577; bh=kKBDfEdMScFcAuwDpyffQFKC/EUrt05ORh8 xaLZ4kMs=; b=STTPjkZ1OqHY+g//EzBvYnhJNosmbgal7jU5JWIt+bJ4FizqInS Xcv4zamWksjgS+WzmV3JBNxVcdAOx3RQ+Uy2h5uDWop388Dh0kXSNeTimR0KCoIF jgJ8S79baFse7fMAfoc/5o2SBCWp2lybWeArlbFqZbvj1G5SqmoVReIYSICDdCD8 AzP/y7OVD4H00sv8bWgLhf6MFTTewiotMvPz51fxcmRt//k0Ck7g0I4Wk4fUl2gr yZyKcW+QyVyixAw6+W+GIWvzv5NIDHZjzJws6LcQ0q7rOrgWcVWQz86ZoH6Lt4A7 o7IzOjYZ0uK90xDchGFb2+f2YYQ78X+IyxQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1696333177; x=1696419577; bh=kKBDfEdMScFcAuwDpyffQFKC/EUrt05ORh8 xaLZ4kMs=; b=jdvYjG2AvrEHQnWG3RN02gPfya5gLqb2ZnpZZVh2pTt8fnDezem zvoXRphnlnBoR5ko5xivtl5iac8vtUcmyg2X/S8hOghoncnGWxT26k4v1O5x2TCd fbU+2SYEnRd1636ywF4t4kS9qZyF5GlWCJ/HgDgmwUWCQLmWa4SBZbB0D0feSoPE Jpj5wtO7dEI3NSDIthy6t8E4M8Rkmey5juw/DWi0o+tRLHOuftf0j43oix+1nZEt fso5ucxRLwboSa6mVJaalTiBKwYEEuJKr71cnKwbyb9g8PnkIgDHmjTakO9mIjLQ 22thQtIP32R01kL2SGzDYW+JmPsOTuAeG/Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfeeigdegudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudektdfg jeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D5708B60089; Tue, 3 Oct 2023 07:39:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-Id: <00b5fa05-5dfd-4e79-a46a-b72915e03608@app.fastmail.com> In-Reply-To: References: <20230928125443.615006-1-mitrutzceclan@gmail.com> <20230928125443.615006-2-mitrutzceclan@gmail.com> <20230930150531.083c51d4@jic23-huawei> <303d2869-2273-f643-e8ff-e27675f929dc@gmail.com> Date: Tue, 03 Oct 2023 13:39:15 +0200 From: "Arnd Bergmann" To: "Andy Shevchenko" , "Dumitru Ceclan" Cc: "Andy Shevchenko" , "Jonathan Cameron" , "Linus Walleij" , "Bartosz Golaszewski" , "open list:GPIO SUBSYSTEM" , "Lars-Peter Clausen" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Michael Walle" , "ChiaEn Wu" , "Niklas Schnelle" , =?UTF-8?Q?Leonard_G=C3=B6hrs?= , "Mike Looijmans" , "Haibo Chen" , "Hugo Villeneuve" , "Ceclan Dumitru" , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: adc: ad7173: add AD7173 driver Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 04:39:49 -0700 (PDT) On Tue, Oct 3, 2023, at 13:02, Andy Shevchenko wrote: > On Tue, Oct 3, 2023 at 1:57=E2=80=AFPM Ceclan Dumitru-Ioan > wrote: >> On 10/3/23 13:45, Andy Shevchenko wrote: >> > On Tue, Oct 03, 2023 at 01:33:36PM +0300, Ceclan Dumitru-Ioan wrote: >> >> On 9/30/23 17:05, Jonathan Cameron wrote: >> >>>> >> >>>> + select GPIO_REGMAP >> >>> If you are selecting it, why does it have if guards in the driver. >> >>> I prefer the select here, so drop this if guards. >> >> From what i checked, selecting GPIO_REGMAP does not select GPIOLIB= but only REGMAP. I think the correct solution for this is to use select GPIO_REGMAP if GPIOLIB which matches what the driver does.=20 >> >> Also, in the thread from V1 Arnd Bergmann suggested: >> >> " I think the best way to handle these is to remove both >> >> the 'select' and the #ifdef in the driver and instead use >> >> 'if (IS_ENABLED(CONFIG_GPIOLIB))' to handle optional gpio >> >> providers in the code. " >> > Why not simply to be dependent on GPIOLIB like other drivers do in = this folder? Some (possibly all) of the other drivers are gpiolib users that do not function without gpiolib. This one is only a provider and not a consumer, and the gpiolib functionality in it is optional, so I think there is technically no dependency, even if in practice gpiolib is always there. >> I followed the suggestion given by Arnd. The full argument: >> >> "From a Kconfig perspective, any user-visible symbol ideally only uses >> 'depends on', while hidden symbols usually use 'select'. >> >> For the GPIOLIB symbol specifically, we have a mix of both, but the >> overall usage is that gpio consumers only use 'depends on', >> while some of the providers use 'select'. This risks causing build >> breakage from a dependency loop when combined with other symbols >> that have the same problem (e.g. I2C), but it tends to work out >> as long as a strong hierarchy is kept. In particular, using 'select' >> from an arch/*/Kconfig platform option is generally harmless as >> long as those don't depend on anything else. >> >> The new driver is a gpio provider and at least ad4130 and >> ad5592r uses 'select' here, but then again ad74115 and >> ad74113 use 'depends on' and ads7950 uses neither. >> >> I think the best way to handle these is to remove both >> the 'select' and the #ifdef in the driver and instead use >> 'if (IS_ENABLED(CONFIG_GPIOLIB))' to handle optional gpio >> providers in the code." >> >> I do not have a lot of experience with this subject. >> As such, if you consider the argument invalid, mention it and i will >> change to 'depends on'. > > I see, I would ask GPIOLIB maintainers about this. > I don't know if there is any plan to fix this through the entire > kernel and which way has been chosen for that. I think the way we have handled it in the past is to not touch existing drivers unless there is a problem with circular dependencies, and then we change a bunch of 'select' to 'depends on' to make it work again. Changing all the wrong ones at once would be nice, but likely cause introduce other dependency problems, but circular dependencies and incorrect defaults in defconfig builds. In the long run, we might decide to make gpiolib unconditional all architectures, but for the moment that causes bloat on small memory configurations like most m68k or armv7-m. Arnd