]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
memory: ti-gpmc: Alloc per driver private struct
authorVignesh Raghavendra <vigneshr@ti.com>
Wed, 5 Mar 2025 08:41:30 +0000 (14:11 +0530)
committerTom Rini <trini@konsulko.com>
Thu, 13 Mar 2025 20:23:05 +0000 (14:23 -0600)
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 <vigneshr@ti.com>
drivers/memory/ti-gpmc.c

index e979c431e333ada01b4f1aa3d8e081149841c906..29e02f12ae0329e5b80e68791feeb6116c396e7e 100644 (file)
@@ -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),
 };