--- zzzz-none-000/linux-3.10.107/drivers/mtd/nand/ams-delta.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mtd/nand/ams-delta.c 2021-02-04 17:41:59.000000000 +0000 @@ -17,7 +17,6 @@ */ #include -#include #include #include #include @@ -184,7 +183,7 @@ return -ENXIO; /* Allocate memory for MTD device structure and private data */ - ams_delta_mtd = kmalloc(sizeof(struct mtd_info) + + ams_delta_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); if (!ams_delta_mtd) { printk (KERN_WARNING "Unable to allocate E3 NAND MTD device structure.\n"); @@ -197,10 +196,6 @@ /* Get pointer to private data */ this = (struct nand_chip *) (&ams_delta_mtd[1]); - /* Initialize structures */ - memset(ams_delta_mtd, 0, sizeof(struct mtd_info)); - memset(this, 0, sizeof(struct nand_chip)); - /* Link the private data with the MTD structure */ ams_delta_mtd->priv = this; @@ -258,7 +253,6 @@ out_mtd: gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); out_gpio: - platform_set_drvdata(pdev, NULL); gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); iounmap(io_base); out_free: @@ -292,7 +286,6 @@ .remove = ams_delta_cleanup, .driver = { .name = "ams-delta-nand", - .owner = THIS_MODULE, }, };