[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240702082251.ljdaz2b7agabbm76@pengutronix.de>
Date: Tue, 2 Jul 2024 10:22:51 +0200
From: Marco Felsch <m.felsch@...gutronix.de>
To: Sergei Shtylyov <sergei.shtylyov@...il.com>
Cc: Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Russell King <linux@...linux.org.uk>, Joel Stanley <joel@....id.au>,
Andrew Jeffery <andrew@...econstruct.com.au>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Vladimir Zapolskiy <vz@...ia.com>, Andrew Lunn <andrew@...n.ch>,
Gregory Clement <gregory.clement@...tlin.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
Tony Lindgren <tony@...mide.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Dinh Nguyen <dinguyen@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Jonathan Neuschäfer <j.neuschaefer@....net>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-aspeed@...ts.ozlabs.org,
imx@...ts.linux.dev, linux-omap@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-tegra@...r.kernel.org,
openbmc@...ts.ozlabs.org, linuxppc-dev@...ts.ozlabs.org,
linux-mips@...r.kernel.org, loongarch@...ts.linux.dev
Subject: Re: [PATCH 2/9] mtd: add mtd_is_master helper
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 <m.felsch@...gutronix.de>
> > ---
> > 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
Powered by blists - more mailing lists