From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F00D616419 for ; Tue, 2 Jul 2024 08:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719908642; cv=none; b=kRBwtOBhLAayKxe/GCgOpj2CE1MsaRLgieZaORk38PCJtVlOwJQGDlGLDtRWxd6bOIHcQYjvNxvPCXhtpAWvV54c9TZsV/0NptlPkP2NOs/ZLKPSHEGFjyk/VS9RskbQPImA3l6aCXvQq02WPYlZ2YBMtMZz5wifiIjCNsGhb+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719908642; c=relaxed/simple; bh=PF7t4m8gFjUEXljEAYhJjqo97jcQQ/DgD6Wg064kH8I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dbLFAfFY5MRCn/V4/qGGN5lCDxH3EScU10ktM01l+SMzwNVovkxZKEeaBGB9fZyF8SvBd+XhzqElWBy5TAWrUNd/R8UexU2nTQtZGJ6ED14Sy47YJ0PGIi9+PLpa4ug4HJHHWp3B4vBUVKjKRP5n19GXjRd3FezT5XZFrSnT8fM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1sOYmu-00011E-US; Tue, 02 Jul 2024 10:22:56 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) 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 1sOYmp-006ZAc-UQ; Tue, 02 Jul 2024 10:22:51 +0200 Received: from mfe by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sOYmp-00ANey-2Z; Tue, 02 Jul 2024 10:22:51 +0200 Date: Tue, 2 Jul 2024 10:22:51 +0200 From: Marco Felsch To: Sergei Shtylyov Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Arnd Bergmann , Greg Kroah-Hartman , Bartosz Golaszewski , Russell King , Joel Stanley , Andrew Jeffery , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Vladimir Zapolskiy , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Tony Lindgren , Geert Uytterhoeven , Magnus Damm , Dinh Nguyen , Thierry Reding , Jonathan Hunter , Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , Thomas Bogendoerfer , Huacai Chen , WANG Xuerui , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, imx@lists.linux.dev, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, openbmc@lists.ozlabs.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, loongarch@lists.linux.dev Subject: Re: [PATCH 2/9] mtd: add mtd_is_master helper Message-ID: <20240702082251.ljdaz2b7agabbm76@pengutronix.de> References: <20240701-b4-v6-10-topic-usbc-tcpci-v1-0-3fd5f4a193cc@pengutronix.de> <20240701-b4-v6-10-topic-usbc-tcpci-v1-2-3fd5f4a193cc@pengutronix.de> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-omap@vger.kernel.org On 24-07-01, Sergei Shtylyov wrote: > On 7/1/24 4:53 PM, Marco Felsch wrote: > > > Provide a simple helper to make it easy to detect an master mtd device. > > > > Signed-off-by: Marco Felsch > > --- > > include/linux/mtd/mtd.h | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h > > index 8d10d9d2e830..bf3fc2ea7230 100644 > > --- a/include/linux/mtd/mtd.h > > +++ b/include/linux/mtd/mtd.h > > @@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd) > > return mtd; > > } > > > > +static inline bool mtd_is_master(struct mtd_info *mtd) > > +{ > > + return mtd->parent ? false : true; > > Perhaps: > > return !mtd->parent; Sure, if you prefer this style rather I will change it. Regards, Marco