From: Christoph Hellwig Date: Mon, 23 Aug 2021 07:33:55 +0000 (+0200) Subject: mtd/rfd_ftl: don't cast away the type when calling add_mtd_blktrans_dev X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=a0faf5fdfb9967b33eda5eafcb55470180216af3;p=linux.git mtd/rfd_ftl: don't cast away the type when calling add_mtd_blktrans_dev Pass the actual mtd_blktrans_dev instead of casting the containing structure to void *. Signed-off-by: Christoph Hellwig Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-5-hch@lst.de --- diff --git a/drivers/mtd/rfd_ftl.c b/drivers/mtd/rfd_ftl.c index af20a0a711089..c546f8c5f24d6 100644 --- a/drivers/mtd/rfd_ftl.c +++ b/drivers/mtd/rfd_ftl.c @@ -783,7 +783,7 @@ static void rfd_ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) printk(KERN_INFO PREFIX "name: '%s' type: %d flags %x\n", mtd->name, mtd->type, mtd->flags); - if (!add_mtd_blktrans_dev((void*)part)) + if (!add_mtd_blktrans_dev(&part->mbd)) return; } out: