From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>,
Tudor Ambarus <Tudor.Ambarus@microchip.com>,
Richard Weinberger <richard@nod.at>,
Boris Brezillon <boris.brezillon@collabora.com>,
linux-mtd@lists.infradead.org,
Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH 45/62] mtd: rawnand: r852: Stop using nand_release()
Date: Mon, 11 May 2020 15:10:38 +0200 [thread overview]
Message-ID: <20200511151038.62727bbd@xps13> (raw)
In-Reply-To: <fd705f87-2d40-bb2f-99cb-6583e775e2c5@cogentembedded.com>
Hi Sergei,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> wrote on Mon, 11
May 2020 13:33:01 +0300:
> Hello
>
> On 10.05.2020 15:12, Miquel Raynal wrote:
>
> > This helper is not very useful and very often people get confused:
> > they use nand_release() instead of nand_cleanup().
> >
> > Let's stop using nand_release() by calling mtd_device_unregister() and
> > nand_cleanup() directly.
> >
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> > Cc: Maxim Levitsky <maximlevitsky@gmail.com>
> > ---
> > drivers/mtd/nand/raw/r852.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/r852.c b/drivers/mtd/nand/raw/r852.c
> > index 77774250fb11..f865e3a47b01 100644
> > --- a/drivers/mtd/nand/raw/r852.c
> > +++ b/drivers/mtd/nand/raw/r852.c
> > @@ -651,7 +651,8 @@ static int r852_register_nand_device(struct r852_device *dev)
> > dev->card_registered = 1;
> > return 0;
> > error3:
> > - nand_release(dev->chip);
> > + WARN_ON(mtd_device_unregister(nand_to_mtd(dev->chip)));
>
> Sometimes you declare a variable to receive the result, sometimes (more seldom) you don't... What guides you?
Absolutely. The logic (if any) was:
Use "ret", unless I think it does not fit very well the driver's style
or the location where I put it. So in the end, as I consider that both
are totally fine, it's a bit mixed and the choice very personnal. Do you
think it is a problem?
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-05-11 13:11 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-10 12:11 [PATCH 00/62] mtd: rawnand: Get rid of nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 01/62] mtd: rawnand: ams-delta: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 02/62] mtd: rawnand: au1550nd: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 03/62] mtd: rawnand: bcm47xx: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 04/62] mtd: rawnand: brcmnand: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 05/62] mtd: rawnand: cadence: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 06/62] mtd: rawnand: cafe: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 07/62] mtd: rawnand: cmx270: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 08/62] mtd: rawnand: cs553x: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 09/62] mtd: rawnand: davinci: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 10/62] mtd: rawnand: denali: Delete items from the list in the _remove() path Miquel Raynal
2020-05-11 2:47 ` Masahiro Yamada
2020-05-10 12:11 ` [PATCH 11/62] mtd: rawnand: denali: Stop using nand_release() Miquel Raynal
2020-05-11 2:49 ` Masahiro Yamada
2020-05-10 12:11 ` [PATCH 12/62] mtd: rawnand: diskonchip: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 13/62] mtd: rawnand: diskonchip: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 14/62] mtd: rawnand: fsl_elbc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 15/62] mtd: rawnand: fsl_ifc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 16/62] mtd: rawnand: fsl_upm: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 17/62] mtd: rawnand: fsmc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 18/62] mtd: rawnand: gpio: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 19/62] mtd: rawnand: gpmi: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 20/62] mtd: rawnand: hisi504: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 21/62] mtd: rawnand: ingenic: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 22/62] mtd: rawnand: ingenic: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 23/62] mtd: rawnand: lpc32xx_mlc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 24/62] mtd: rawnand: lpc32xx_slc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 25/62] mtd: rawnand: marvell: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 26/62] mtd: rawnand: mpc5121: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 27/62] mtd: rawnand: mtk: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 28/62] mtd: rawnand: mtk: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 29/62] mtd: rawnand: mxc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 30/62] mtd: rawnand: mxic: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 31/62] mtd: rawnand: ndfc: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 32/62] mtd: rawnand: omap2: " Miquel Raynal
2020-05-10 12:11 ` [PATCH 33/62] mtd: rawnand: orion: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 34/62] mtd: rawnand: orion: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 35/62] mtd: rawnand: oxnas: Keep track of registered devices Miquel Raynal
2020-05-10 12:11 ` [PATCH 36/62] mtd: rawnand: oxnas: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 37/62] mtd: rawnand: oxnas: Unregister all devices on error Miquel Raynal
2020-05-10 12:11 ` [PATCH 38/62] mtd: rawnand: oxnas: Release all devices in the _remove() path Miquel Raynal
2020-05-10 12:11 ` [PATCH 39/62] mtd: rawnand: oxnas: Stop using nand_release() Miquel Raynal
2020-05-10 12:11 ` [PATCH 40/62] mtd: rawnand: pasemi: Fix the probe error path Miquel Raynal
2020-05-10 12:11 ` [PATCH 41/62] mtd: rawnand: pasemi: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 42/62] mtd: rawnand: plat_nand: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 43/62] mtd: rawnand: plat_nand: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 44/62] mtd: rawnand: qcom: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 45/62] mtd: rawnand: r852: " Miquel Raynal
2020-05-11 10:33 ` Sergei Shtylyov
2020-05-11 13:10 ` Miquel Raynal [this message]
2020-05-12 20:09 ` Sergei Shtylyov
2020-05-10 12:12 ` [PATCH 46/62] mtd: rawnand: s3c2410: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 47/62] mtd: rawnand: sh_flctl: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 48/62] mtd: rawnand: sharpsl: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 49/62] mtd: rawnand: sharpsl: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 50/62] mtd: ranwnand: socrates: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 51/62] mtd: rawnand: socrates: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 52/62] mtd: rawnand: stm32_fmc2: " Miquel Raynal
2020-05-13 7:48 ` Christophe Kerello
2020-05-10 12:12 ` [PATCH 53/62] mtd: rawnand: sunxi: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 54/62] mtd: rawnand: sunxi: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 55/62] mtd: rawnand: tango: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 56/62] mtd: rawnand: tmio: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 57/62] mtd: rawnand: tmio: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 58/62] mtd: rawnand: txx9ndfmc: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 59/62] mtd: rawnand: vf610: " Miquel Raynal
2020-05-10 12:12 ` [PATCH 60/62] mtd: rawnand: xway: Fix the probe error path Miquel Raynal
2020-05-10 12:12 ` [PATCH 61/62] mtd: rawnand: xway: Stop using nand_release() Miquel Raynal
2020-05-10 12:12 ` [PATCH 62/62] mtd: rawnand: " Miquel Raynal
2020-05-11 2:46 ` [PATCH 00/62] mtd: rawnand: Get rid of nand_release() Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200511151038.62727bbd@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=Tudor.Ambarus@microchip.com \
--cc=boris.brezillon@collabora.com \
--cc=linux-mtd@lists.infradead.org \
--cc=maximlevitsky@gmail.com \
--cc=richard@nod.at \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).