--- zzzz-none-000/linux-3.10.107/drivers/mtd/maps/pxa2xx-flash.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mtd/maps/pxa2xx-flash.c 2021-02-04 17:41:59.000000000 +0000 @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -49,7 +48,7 @@ static int pxa2xx_flash_probe(struct platform_device *pdev) { - struct flash_platform_data *flash = pdev->dev.platform_data; + struct flash_platform_data *flash = dev_get_platdata(&pdev->dev); struct pxa2xx_flash_info *info; struct resource *res; @@ -61,7 +60,7 @@ if (!info) return -ENOMEM; - info->map.name = (char *) flash->name; + info->map.name = flash->name; info->map.bankwidth = flash->width; info->map.phys = res->start; info->map.size = resource_size(res); @@ -72,8 +71,8 @@ info->map.name); return -ENOMEM; } - info->map.cached = - ioremap_cached(info->map.phys, info->map.size); + info->map.cached = memremap(info->map.phys, info->map.size, + MEMREMAP_WB); if (!info->map.cached) printk(KERN_WARNING "Failed to ioremap cached %s\n", info->map.name); @@ -94,7 +93,7 @@ iounmap(info->map.cached); return -EIO; } - info->mtd->owner = THIS_MODULE; + info->mtd->dev.parent = &pdev->dev; mtd_device_parse_register(info->mtd, probes, NULL, flash->parts, flash->nr_parts); @@ -107,14 +106,12 @@ { struct pxa2xx_flash_info *info = platform_get_drvdata(dev); - platform_set_drvdata(dev, NULL); - mtd_device_unregister(info->mtd); map_destroy(info->mtd); iounmap(info->map.virt); if (info->map.cached) - iounmap(info->map.cached); + memunmap(info->map.cached); kfree(info); return 0; } @@ -134,7 +131,6 @@ static struct platform_driver pxa2xx_flash_driver = { .driver = { .name = "pxa2xx-flash", - .owner = THIS_MODULE, }, .probe = pxa2xx_flash_probe, .remove = pxa2xx_flash_remove,