--- zzzz-none-000/linux-3.10.107/drivers/pcmcia/pd6729.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/pcmcia/pd6729.c 2021-02-04 17:41:59.000000000 +0000 @@ -644,6 +644,7 @@ if (!pci_resource_start(dev, 0)) { dev_warn(&dev->dev, "refusing to load the driver as the " "io_base is NULL.\n"); + ret = -ENOMEM; goto err_out_disable; } @@ -673,6 +674,7 @@ mask = pd6729_isa_scan(); if (irq_mode == 0 && mask == 0) { dev_warn(&dev->dev, "no ISA interrupt is available.\n"); + ret = -ENODEV; goto err_out_free_res; } @@ -705,11 +707,9 @@ } } else { /* poll Card status change */ - init_timer(&socket->poll_timer); - socket->poll_timer.function = pd6729_interrupt_wrapper; - socket->poll_timer.data = (unsigned long)socket; - socket->poll_timer.expires = jiffies + HZ; - add_timer(&socket->poll_timer); + setup_timer(&socket->poll_timer, pd6729_interrupt_wrapper, + (unsigned long)socket); + mod_timer(&socket->poll_timer, jiffies + HZ); } for (i = 0; i < MAX_SOCKETS; i++) { @@ -762,7 +762,7 @@ kfree(socket); } -static DEFINE_PCI_DEVICE_TABLE(pd6729_pci_ids) = { +static const struct pci_device_id pd6729_pci_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6729) }, { } }; @@ -775,15 +775,4 @@ .remove = pd6729_pci_remove, }; -static int pd6729_module_init(void) -{ - return pci_register_driver(&pd6729_pci_driver); -} - -static void pd6729_module_exit(void) -{ - pci_unregister_driver(&pd6729_pci_driver); -} - -module_init(pd6729_module_init); -module_exit(pd6729_module_exit); +module_pci_driver(pd6729_pci_driver);