提交 e3671ac4 编写于 作者: F Feng Tang 提交者: Greg Kroah-Hartman

serial: mfd: fix bug in serial_hsu_remove()

Medfield HSU driver deal with 4 pci devices(3 uart ports + 1 dma controller),
so in pci remove func, we need handle them differently
Signed-off-by: NFeng Tang <feng.tang@intel.com>
Signed-off-by: NAlan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 476f771c
...@@ -1423,7 +1423,6 @@ static void hsu_global_init(void) ...@@ -1423,7 +1423,6 @@ static void hsu_global_init(void)
} }
phsu = hsu; phsu = hsu;
hsu_debugfs_init(hsu); hsu_debugfs_init(hsu);
return; return;
...@@ -1435,18 +1434,20 @@ static void hsu_global_init(void) ...@@ -1435,18 +1434,20 @@ static void hsu_global_init(void)
static void serial_hsu_remove(struct pci_dev *pdev) static void serial_hsu_remove(struct pci_dev *pdev)
{ {
struct hsu_port *hsu; void *priv = pci_get_drvdata(pdev);
int i; struct uart_hsu_port *up;
hsu = pci_get_drvdata(pdev); if (!priv)
if (!hsu)
return; return;
for (i = 0; i < 3; i++) /* For port 0/1/2, priv is the address of uart_hsu_port */
uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port); if (pdev->device != 0x081E) {
up = priv;
uart_remove_one_port(&serial_hsu_reg, &up->port);
}
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
free_irq(hsu->irq, hsu); free_irq(pdev->irq, priv);
pci_disable_device(pdev); pci_disable_device(pdev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册