--- zzzz-none-000/linux-3.10.107/drivers/pcmcia/electra_cf.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/pcmcia/electra_cf.c 2021-02-04 17:41:59.000000000 +0000 @@ -30,6 +30,8 @@ #include #include #include +#include +#include #include #include @@ -46,14 +48,14 @@ struct platform_device *ofdev; unsigned long mem_phys; - void __iomem * mem_base; + void __iomem *mem_base; unsigned long mem_size; - void __iomem * io_virt; + void __iomem *io_virt; unsigned int io_base; unsigned int io_size; u_int irq; struct resource iomem; - void __iomem * gpio_base; + void __iomem *gpio_base; int gpio_detect; int gpio_vsense; int gpio_3v; @@ -200,7 +202,7 @@ if (err) return -EINVAL; - cf = kzalloc(sizeof *cf, GFP_KERNEL); + cf = kzalloc(sizeof(*cf), GFP_KERNEL); if (!cf) return -ENOMEM; @@ -214,8 +216,10 @@ cf->io_size = PAGE_ALIGN(resource_size(&io)); area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END); - if (area == NULL) - return -ENOMEM; + if (area == NULL) { + status = -ENOMEM; + goto fail1; + } cf->io_virt = (void __iomem *)(area->addr); @@ -318,7 +322,8 @@ iounmap(cf->mem_base); if (cf->gpio_base) iounmap(cf->gpio_base); - device_init_wakeup(&ofdev->dev, 0); + if (area) + device_init_wakeup(&ofdev->dev, 0); kfree(cf); return status; @@ -357,8 +362,7 @@ static struct platform_driver electra_cf_driver = { .driver = { - .name = (char *)driver_name, - .owner = THIS_MODULE, + .name = driver_name, .of_match_table = electra_cf_match, }, .probe = electra_cf_probe, @@ -368,5 +372,5 @@ module_platform_driver(electra_cf_driver); MODULE_LICENSE("GPL"); -MODULE_AUTHOR ("Olof Johansson "); +MODULE_AUTHOR("Olof Johansson "); MODULE_DESCRIPTION("PA Semi Electra CF driver");