[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210816100114.384f01b9@xps13>
Date: Mon, 16 Aug 2021 10:01:14 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Evgeny Novikov <novikov@...ras.ru>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Kirill Shilimanov <kirill.shilimanov@...wei.com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"ldv-project@...uxtesting.org" <ldv-project@...uxtesting.org>
Subject: Re: [PATCH] mtd: rawnand: mxic: Enable and prepare clocks in probe
Hi Andy,
Andy Shevchenko <andy.shevchenko@...il.com> wrote on Thu, 12 Aug 2021
15:13:10 +0300:
> On Thursday, August 12, 2021, Evgeny Novikov <novikov@...ras.ru> wrote:
>
> > It seems that mxic_nfc_probe() missed invocation of
> > mxic_nfc_clk_enable(). The patch fixed that. In addition, error handling
> > was refined appropriately.
>
>
> NAK. Until you provide a deeper analysis, like how this works before your
> change.
>
>
> Please, don’t blindly generate patches, this can even your bot do, just
> think about each change and preferable test on the real hardware.
>
> The above is to all your lovely contributions.
>
>
> >
> > Found by Linux Driver Verification project (linuxtesting.org).
> >
> > Signed-off-by: Evgeny Novikov <novikov@...ras.ru>
> > Co-developed-by: Kirill Shilimanov <kirill.shilimanov@...wei.com>
> > Signed-off-by: Kirill Shilimanov <kirill.shilimanov@...wei.com>
> > ---
> > drivers/mtd/nand/raw/mxic_nand.c | 16 ++++++++++++----
> > 1 file changed, 12 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/raw/mxic_nand.c b/drivers/mtd/nand/raw/mxic_
> > nand.c
> > index da1070993994..37e75bf60ee5 100644
> > --- a/drivers/mtd/nand/raw/mxic_nand.c
> > +++ b/drivers/mtd/nand/raw/mxic_nand.c
> > @@ -509,9 +509,15 @@ static int mxic_nfc_probe(struct platform_device
> > *pdev)
> > if (IS_ERR(nfc->send_dly_clk))
> > return PTR_ERR(nfc->send_dly_clk);
> >
> > + err = mxic_nfc_clk_enable(nfc);
> > + if (err)
> > + return err;
As Andy said, this is not needed.
> > +
> > nfc->regs = devm_platform_ioremap_resource(pdev, 0);
> > - if (IS_ERR(nfc->regs))
> > - return PTR_ERR(nfc->regs);
> > + if (IS_ERR(nfc->regs)) {
> > + err = PTR_ERR(nfc->regs);
> > + goto fail;
> > + }
> >
> > nand_chip = &nfc->chip;
> > mtd = nand_to_mtd(nand_chip);
> > @@ -527,8 +533,10 @@ static int mxic_nfc_probe(struct platform_device
> > *pdev)
> > nand_chip->controller = &nfc->controller;
> >
> > irq = platform_get_irq(pdev, 0);
> > - if (irq < 0)
> > - return irq;
> > + if (irq < 0) {
> > + err = irq;
> > + goto fail;
However some reworking is needed in the error path.
That goto statement should be renamed and devm_request_irq() should not
jump to it.
> > + }
> >
> > mxic_nfc_hw_init(nfc);
> >
> > --
> > 2.26.2
> >
> >
>
Thanks,
Miquèl
Powered by blists - more mailing lists