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")
Signed-off-by: Vignesh Raghavendra <[email protected]>
---
 drivers/memory/ti-gpmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/memory/ti-gpmc.c b/drivers/memory/ti-gpmc.c
index e979c431e333..29e02f12ae03 100644
--- a/drivers/memory/ti-gpmc.c
+++ b/drivers/memory/ti-gpmc.c
@@ -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),
 };
-- 
2.48.1

Reply via email to