Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] lirc_bt829: Enable and disable device

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>

authored by

Ben Hutchings and committed by
Mauro Carvalho Chehab
cfe1b7a7 fd39abee

+8 -1
+8 -1
drivers/staging/media/lirc/lirc_bt829.c
··· 126 126 if (pdev == NULL) 127 127 return -ENODEV; 128 128 129 + rc = pci_enable_device(pdev); 130 + if (rc) 131 + goto err_put_dev; 132 + 129 133 if (!atir_init_start()) { 130 134 rc = -ENODEV; 131 - goto err_put_dev; 135 + goto err_disable; 132 136 } 133 137 134 138 strcpy(atir_driver.name, "ATIR"); ··· 158 154 159 155 err_unmap: 160 156 iounmap(pci_addr_lin); 157 + err_disable: 158 + pci_disable_device(pdev); 161 159 err_put_dev: 162 160 pci_dev_put(pdev); 163 161 return rc; ··· 172 166 173 167 lirc_unregister_driver(atir_minor); 174 168 iounmap(pci_addr_lin); 169 + pci_disable_device(pdev); 175 170 pci_dev_put(pdev); 176 171 } 177 172