We must not assume that the PCI device is already enabled.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
if (pdev == NULL)
return -ENODEV;
+ rc = pci_enable_device(pdev);
+ if (rc)
+ goto err_put_dev;
+
if (!atir_init_start()) {
rc = -ENODEV;
- goto err_put_dev;
+ goto err_disable;
}
strcpy(atir_driver.name, "ATIR");
err_unmap:
iounmap(pci_addr_lin);
+err_disable:
+ pci_disable_device(pdev);
err_put_dev:
pci_dev_put(pdev);
return rc;
lirc_unregister_driver(atir_minor);
iounmap(pci_addr_lin);
+ pci_disable_device(pdev);
pci_dev_put(pdev);
}