mtd/ftl: don't cast away the type when calling add_mtd_blktrans_dev
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Aug 2021 07:33:54 +0000 (09:33 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 23 Aug 2021 08:01:04 +0000 (10:01 +0200)
Pass the actual mtd_blktrans_dev instead of casting the containing
structure to void *.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-4-hch@lst.de
drivers/mtd/ftl.c

index 9b33c08..f655d29 100644 (file)
@@ -1029,7 +1029,7 @@ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
 
                partition->mbd.tr = tr;
                partition->mbd.devnum = -1;
-               if (!add_mtd_blktrans_dev((void *)partition))
+               if (!add_mtd_blktrans_dev(&partition->mbd))
                        return;
        }