From: Boris BREZILLON Date: Thu, 10 Dec 2015 08:00:31 +0000 (+0100) Subject: staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ba4ed8605cb09b2cb72bf14499cf4605a0f9eb23;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: mt29f_spinand: use the mtd instance embedded in struct nand_chip struct nand_chip now embeds an mtd device, use it instead of allocating a new one. Signed-off-by: Boris Brezillon Signed-off-by: Brian Norris --- diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index 8924a9645a43..8171b741ff86 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -903,9 +903,7 @@ static int spinand_probe(struct spi_device *spi_nand) chip->options |= NAND_CACHEPRG; chip->select_chip = spinand_select_chip; - mtd = devm_kzalloc(&spi_nand->dev, sizeof(struct mtd_info), GFP_KERNEL); - if (!mtd) - return -ENOMEM; + mtd = nand_to_mtd(chip); dev_set_drvdata(&spi_nand->dev, mtd);