public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: vadivel.muruganx.ramuthevar@linux.intel.com,
	linux-mtd@lists.infradead.org, vigneshr@ti.com,
	linux-kernel@vger.kernel.org, richard@nod.at
Subject: Re: [PATCH] mtd: rawnand: intel: remove broken code
Date: Mon, 4 Jan 2021 14:19:32 +0100	[thread overview]
Message-ID: <20210104141932.1037f8e3@xps13> (raw)
In-Reply-To: <CAFBinCDw_Zwwww88Vd2yU5sMZxYg-NQWHhLiuV7A5rhApeNroA@mail.gmail.com>

Hi Martin,

Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Mon,
4 Jan 2021 14:13:04 +0100:

> Hi Miquel,
> 
> thank you for looking into this
> 
> On Mon, Jan 4, 2021 at 9:48 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> [...]
> > >       nand_set_flash_node(&ebu_host->chip, dev->of_node);
> > > -     if (!mtd->name) {
> > > -             dev_err(ebu_host->dev, "NAND label property is mandatory\n");
> > > -             return -EINVAL;
> > > -     }  
> >
> > This is valid code, it's best to use a label = "my-storage"; property
> > in your NAND DT node. Then mtd->name will be updated by
> > nand_set_flash_node().  
> so you suggest moving the check instead?
> the original code flow was:
>   mtd = NULL;
>   if (!mtd->name)
>      return -EINVAL;
>   mtd = nand_to_mtd(&ebu_host->chip);
>   ...
> 
> by saying that the code itself is valid you're asking me to update the
> flow to the following:
>   mtd = nand_to_mtd(&ebu_host->chip);
>   if (!mtd->name)
>      return -EINVAL;

I actually missed the fact that mtd was used initialized, but yes that
is exactly what I meant!

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2021-01-04 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 22:11 [PATCH] mtd: rawnand: intel: remove broken code Martin Blumenstingl
2021-01-04  8:48 ` Miquel Raynal
2021-01-04 13:13   ` Martin Blumenstingl
2021-01-04 13:19     ` Miquel Raynal [this message]

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=20210104141932.1037f8e3@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=richard@nod.at \
    --cc=vadivel.muruganx.ramuthevar@linux.intel.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