aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-09-06 08:41:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-20 19:30:00 -0400
commite3671ac429fe50cf0c1b4f1dc4b7237207f1d956 (patch)
treeaff4ea579c4fc83abde7b889cce8e6107f8e1be9 /drivers
parent476f771cb9b6cd4845dcd18f16a2f03a89ee63fc (diff)
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: Feng Tang <feng.tang@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/mfd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c
index bc9af503907f..324c385a653d 100644
--- a/drivers/serial/mfd.c
+++ b/drivers/serial/mfd.c
@@ -1423,7 +1423,6 @@ static void hsu_global_init(void)
1423 } 1423 }
1424 1424
1425 phsu = hsu; 1425 phsu = hsu;
1426
1427 hsu_debugfs_init(hsu); 1426 hsu_debugfs_init(hsu);
1428 return; 1427 return;
1429 1428
@@ -1435,18 +1434,20 @@ err_free_region:
1435 1434
1436static void serial_hsu_remove(struct pci_dev *pdev) 1435static void serial_hsu_remove(struct pci_dev *pdev)
1437{ 1436{
1438 struct hsu_port *hsu; 1437 void *priv = pci_get_drvdata(pdev);
1439 int i; 1438 struct uart_hsu_port *up;
1440 1439
1441 hsu = pci_get_drvdata(pdev); 1440 if (!priv)
1442 if (!hsu)
1443 return; 1441 return;
1444 1442
1445 for (i = 0; i < 3; i++) 1443 /* For port 0/1/2, priv is the address of uart_hsu_port */
1446 uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port); 1444 if (pdev->device != 0x081E) {
1445 up = priv;
1446 uart_remove_one_port(&serial_hsu_reg, &up->port);
1447 }
1447 1448
1448 pci_set_drvdata(pdev, NULL); 1449 pci_set_drvdata(pdev, NULL);
1449 free_irq(hsu->irq, hsu); 1450 free_irq(pdev->irq, priv);
1450 pci_disable_device(pdev); 1451 pci_disable_device(pdev);
1451} 1452}
1452 1453