Skip to content

Commit

Permalink
serial: mfd: fix bug in serial_hsu_remove()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Feng Tang authored and Greg Kroah-Hartman committed Sep 20, 2010
1 parent 476f771 commit e3671ac
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions drivers/serial/mfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,6 @@ static void hsu_global_init(void)
}

phsu = hsu;

hsu_debugfs_init(hsu);
return;

Expand All @@ -1435,18 +1434,20 @@ static void hsu_global_init(void)

static void serial_hsu_remove(struct pci_dev *pdev)
{
struct hsu_port *hsu;
int i;
void *priv = pci_get_drvdata(pdev);
struct uart_hsu_port *up;

hsu = pci_get_drvdata(pdev);
if (!hsu)
if (!priv)
return;

for (i = 0; i < 3; i++)
uart_remove_one_port(&serial_hsu_reg, &hsu->port[i].port);
/* For port 0/1/2, priv is the address of uart_hsu_port */
if (pdev->device != 0x081E) {
up = priv;
uart_remove_one_port(&serial_hsu_reg, &up->port);
}

pci_set_drvdata(pdev, NULL);
free_irq(hsu->irq, hsu);
free_irq(pdev->irq, priv);
pci_disable_device(pdev);
}

Expand Down

0 comments on commit e3671ac

Please sign in to comment.