Skip to contentSkip to conversation

memory: ti-gpmc: Alloc per driver private struct

PATCH In review Vignesh Raghavendra 2 participants 2 messages Mar 5, 2025 – Mar 13, 2025 Memory controller drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: ti-gpmc: Alloc per driver private struct

Driver uses dev_get_priv() but never allocates it in its declaration leading to various crashes. Fix this by explicitly allocating the storage.

Fixes 9b0b5648d6e4 ("memory: Add TI GPMC driver")
---
 drivers/memory/ti-gpmc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/memory/ti-gpmc.c +1 -0
index e979c431e333..29e02f12ae03 100644
@@ -1242,4 +1242,5 @@ U_BOOT_DRIVER(ti_gpmc) = {
 	.of_match = gpmc_dt_ids,
 	.probe  = gpmc_probe,
 	.flags  = DM_FLAG_ALLOC_PRIV_DMA,
+	.priv_auto = sizeof(struct ti_gpmc),
 };
Signature · 1 line
2.48.1
#1 lore raw
Quoted 5 lines · Vignesh Raghavendra

Driver uses dev_get_priv() but never allocates it in its declaration leading to various crashes. Fix this by explicitly allocating the storage.

Applied to u-boot/next, thanks!

[1/1] memory: ti-gpmc: Alloc per driver private struct

      commit: 628908f849e1a8c99c47aad0df0e4feb7a6b2c9d
Signature · 1 line
Tom