Files
u-boot/drivers
Dinesh Maniyam 5d54230223 mtd: nand: cadence: Fix device assignment to avoid warm reset issue
The driver currently does:
    mtd->dev->parent = cadence->dev;

This works in Linux because `struct mtd_info` embeds a `struct device`,
so `mtd->dev` is always valid and its `.parent` can be set.

In U-Boot, however, `mtd->dev` is only a pointer to a `struct udevice`.
Dereferencing it before assignment is invalid, which breaks the device
hierarchy. As a result, consumers relying on `mtd->dev` (e.g. partition
parser, reset and re-init paths) operate on a dangling pointer. This
leads to failures during warm reset when the NAND device is accessed
again.

Fix by assigning the device pointer directly:
    mtd->dev = cadence->dev;

This matches U-Boot’s device model, preserves a valid hierarchy, and
resolves the warm reset issue on Cadence NAND.

Fixes: ebc41cad ("drivers: mtd: nand: Add driver for Cadence Nand")
Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-08-23 16:37:05 +02:00
..
2025-07-10 08:41:03 -06:00
2025-04-11 12:16:44 -06:00
2025-07-22 11:30:14 -06:00
2025-06-02 17:26:16 -06:00
2025-08-06 08:41:30 +02:00
2025-04-11 12:16:44 -06:00
2025-07-29 16:44:58 +02:00
2025-07-30 14:55:17 +02:00
2025-06-25 13:42:04 -06:00
2024-04-26 08:28:35 +03:00
2025-04-11 12:16:44 -06:00