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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 282FBCCF9E8 for ; Wed, 25 Sep 2024 16:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Date:Cc:To:From :Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+Ff/Rpve+Ta60DRP8r4iJaXV1DP8bikyvQZOzPF03BM=; b=fbRLF6kq8e3QTvP6tshJNNQR56 Ub6zkJzD7m3ZYi3DF1O/iaYgksROZQhGw9S8F+TF9/8+jX+1Fy2H5RvK33lk3u5Qmh5TF356BMKLH uhGNLIHLvhmfVBafwOa8Vq46wAXqydZD64l06lBQqtN2SDzXcoYvLWIiHsUma5Zfeh5Z1PdDj+/jy 2PCiPIaJ6fKpzjRLkdV3KEbpd2v3GKp2yokM9p1O6u2msomxaV2DKvG+V2auUHCFxptpkIJqTE5Hv glk0zTdq2CeHXjaegt3RwN8crNzs3gXMzIk5LNDpOjkQ3HyxqtzR76sUBquTpvpXR6JpySe6uB7z9 fLSwRuLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stV9l-000000066U1-3F5q; Wed, 25 Sep 2024 16:46:25 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stV6f-000000065pW-00FO for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 16:43:14 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1stV6X-0004ik-9N; Wed, 25 Sep 2024 18:43:05 +0200 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1stV6V-001UVF-VX; Wed, 25 Sep 2024 18:43:03 +0200 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1stV6V-000PDk-2v; Wed, 25 Sep 2024 18:43:03 +0200 Message-ID: Subject: Re: [PATCH RFC 1/3] reset: replace boolean parameters with flags parameter From: Philipp Zabel To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= Cc: Kunihiko Hayashi , Masami Hiramatsu , Lad Prabhakar , Geert Uytterhoeven , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Date: Wed, 25 Sep 2024 18:43:03 +0200 In-Reply-To: References: <20240621-reset-get-deasserted-v1-0-94ee76fb7b7d@pengutronix.de> <20240621-reset-get-deasserted-v1-1-94ee76fb7b7d@pengutronix.de> <5500e3d44be69f5bc843e5b2159f6d0aead24ff9.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_094313_065888_A2881C84 X-CRM114-Status: GOOD ( 23.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Uwe, On Mi, 2024-09-25 at 16:25 +0200, Uwe Kleine-K=C3=B6nig wrote: > Hello Philipp, >=20 > On Wed, Jun 26, 2024 at 06:17:11PM +0200, Philipp Zabel wrote: > > On Sa, 2024-06-22 at 09:47 +0200, Uwe Kleine-K=C3=B6nig wrote: > > > On Fri, Jun 21, 2024 at 04:45:02PM +0200, Philipp Zabel wrote: > > > > @@ -999,8 +1001,9 @@ static struct reset_controller_dev *__reset_fi= nd_rcdev(const struct of_phandle_a > > > > =20 > > > > struct reset_control * > > > > __of_reset_control_get(struct device_node *node, const char *id, i= nt index, > > > > - bool shared, bool optional, bool acquired) > > > > + enum reset_control_flags flags) > > > > { > > > > + bool optional =3D flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL; > > > > bool gpio_fallback =3D false; > > > > struct reset_control *rstc; > > > > struct reset_controller_dev *rcdev; > > > > @@ -1065,7 +1068,7 @@ __of_reset_control_get(struct device_node *no= de, const char *id, int index, > > > > } > > > > =20 > > > > /* reset_list_mutex also protects the rcdev's reset_control list = */ > > > > - rstc =3D __reset_control_get_internal(rcdev, rstc_id, shared, acq= uired); > > > > + rstc =3D __reset_control_get_internal(rcdev, rstc_id, flags); > > >=20 > > > If RESET_CONTROL_FLAGS_BIT_OPTIONAL was passed to > > > __of_reset_control_get(), you're forwarding it to > > > __reset_control_get_internal(). But the latter doesn't do anything wi= th > > > that flag. I wonder if the API would be still less prone to error if > > > you'd filter out RESET_CONTROL_FLAGS_BIT_OPTIONAL before passing to > > > __reset_control_get_internal() and in __reset_control_get_internal() = add > > > a check for unsupported flags. > >=20 > > Yes, I'll do that. For every enum value with the optional bit set, > > there is a corresponding value without it. >=20 > Do you have this still on your todo list? I just review a pwm driver > that would benefit from devm_reset_control_get_exclusive_deasserted(). Thanks for the reminder, just sent a v2. regards Philipp