diff mbox series

nand: brcmnand: return without disabling clock

Message ID 20200402083752.14077-1-noltari@gmail.com
State Accepted
Commit b9ec102bc47fbc6017bd6fa2ce56b0c61cc30047
Delegated to: Daniel Schwierzeck
Headers show
Series nand: brcmnand: return without disabling clock | expand

Commit Message

Álvaro Fernández Rojas April 2, 2020, 8:37 a.m. UTC
Linux Broadcom NAND driver only disabled clock if no childs are initialized.
This section of the code seems to have been accidentally dropped when it was
imported in U-Boot.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Daniel Schwierzeck April 2, 2020, 9:15 a.m. UTC | #1
Am 02.04.20 um 10:37 schrieb Álvaro Fernández Rojas:
> Linux Broadcom NAND driver only disabled clock if no childs are initialized.
> This section of the code seems to have been accidentally dropped when it was
> imported in U-Boot.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Tom Rini April 2, 2020, 3:49 p.m. UTC | #2
On Thu, Apr 02, 2020 at 11:15:51AM +0200, Daniel Schwierzeck wrote:
> 
> 
> Am 02.04.20 um 10:37 schrieb Álvaro Fernández Rojas:
> > Linux Broadcom NAND driver only disabled clock if no childs are initialized.
> > This section of the code seems to have been accidentally dropped when it was
> > imported in U-Boot.
> > 
> > Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> > ---
> >  drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> 
> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

Does this need to go in to v2020.04?  Thanks!
Álvaro Fernández Rojas April 2, 2020, 3:57 p.m. UTC | #3
> El 2 abr 2020, a las 17:49, Tom Rini <trini@konsulko.com> escribió:
> 
> On Thu, Apr 02, 2020 at 11:15:51AM +0200, Daniel Schwierzeck wrote:
>> 
>> 
>> Am 02.04.20 um 10:37 schrieb Álvaro Fernández Rojas:
>>> Linux Broadcom NAND driver only disabled clock if no childs are initialized.
>>> This section of the code seems to have been accidentally dropped when it was
>>> imported in U-Boot.
>>> 
>>> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
>>> ---
>>> drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++-
>>> 1 file changed, 8 insertions(+), 1 deletion(-)
>>> 
>> 
>> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> Does this need to go in to v2020.04?  Thanks!
> 
> -- 
> Tom

Not really. I tested it with a development branch and this affects bcm6362 devices (nand not currently supported), but it doesn’t affect bcm63268 devices (1 device supported).

Best regards,
Álvaro.
Daniel Schwierzeck April 23, 2020, 7:10 p.m. UTC | #4
Am 02.04.20 um 10:37 schrieb Álvaro Fernández Rojas:
> Linux Broadcom NAND driver only disabled clock if no childs are initialized.
> This section of the code seems to have been accidentally dropped when it was
> imported in U-Boot.
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
> ---
>  drivers/mtd/nand/raw/brcmnand/brcmnand.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 

applied to u-boot-mips, thanks.
diff mbox series

Patch

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 5232328e1e..7bdebf5869 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -2714,6 +2714,14 @@  int brcmnand_probe(struct udevice *dev, struct brcmnand_soc *soc)
 	}
 #endif /* __UBOOT__ */
 
+	/* No chip-selects could initialize properly */
+	if (list_empty(&ctrl->host_list)) {
+		ret = -ENODEV;
+		goto err;
+	}
+
+	return 0;
+
 err:
 #ifndef __UBOOT__
 	clk_disable_unprepare(ctrl->clk);
@@ -2722,7 +2730,6 @@  err:
 		clk_disable(ctrl->clk);
 #endif /* __UBOOT__ */
 	return ret;
-
 }
 EXPORT_SYMBOL_GPL(brcmnand_probe);