Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324465
b: refs/heads/master
c: f45651f
h: refs/heads/master
i:
  324463: ce55c76
v: v3
  • Loading branch information
Samuel Iglesias Gonsálvez authored and Greg Kroah-Hartman committed Aug 14, 2012
1 parent 8b9329c commit 2b941a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e58d05a1b24d2c0471c3b4df8f473a7543d7647
refs/heads/master: f45651f9bb22f7ab60d806707be2c75f3d219157
34 changes: 6 additions & 28 deletions trunk/drivers/staging/ipack/bridges/tpci200.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,20 @@ static int control_reg[] = {
TPCI200_CONTROL_D_REG
};

/* Linked list to save the registered devices */
static LIST_HEAD(tpci200_list);

static int tpci200_slot_unregister(struct ipack_device *dev);

static struct tpci200_board *check_slot(struct ipack_device *dev)
{
struct tpci200_board *tpci200;
int found = 0;

if (dev == NULL)
return NULL;

list_for_each_entry(tpci200, &tpci200_list, list) {
if (tpci200->number == dev->bus_nr) {
found = 1;
break;
}
}

if (!found) {
dev_err(&dev->dev, "Carrier not found\n");
tpci200 = dev_get_drvdata(dev->bus->parent);

if (tpci200 == NULL) {
dev_info(&dev->dev, "carrier board not found\n");
return NULL;
}

Expand Down Expand Up @@ -831,8 +823,6 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
/* save the bus number given by ipack to logging purpose */
tpci200->number = tpci200->info->ipack_bus->bus_nr;
dev_set_drvdata(&pdev->dev, tpci200);
/* add the registered device in an internal linked list */
list_add_tail(&tpci200->list, &tpci200_list);

/*
* Give the same IRQ number as the slot number.
Expand All @@ -847,23 +837,16 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
static void __tpci200_pci_remove(struct tpci200_board *tpci200)
{
tpci200_uninstall(tpci200);
list_del(&tpci200->list);
ipack_bus_unregister(tpci200->info->ipack_bus);
kfree(tpci200->info);
kfree(tpci200);
}

static void __devexit tpci200_pci_remove(struct pci_dev *dev)
{
struct tpci200_board *tpci200, *next;
struct tpci200_board *tpci200 = pci_get_drvdata(dev);

/* Search the registered device to uninstall it */
list_for_each_entry_safe(tpci200, next, &tpci200_list, list) {
if (tpci200->info->pdev == dev) {
__tpci200_pci_remove(tpci200);
break;
}
}
__tpci200_pci_remove(tpci200);
}

static DEFINE_PCI_DEVICE_TABLE(tpci200_idtable) = {
Expand All @@ -888,11 +871,6 @@ static int __init tpci200_drvr_init_module(void)

static void __exit tpci200_drvr_exit_module(void)
{
struct tpci200_board *tpci200, *next;

list_for_each_entry_safe(tpci200, next, &tpci200_list, list)
__tpci200_pci_remove(tpci200);

pci_unregister_driver(&tpci200_pci_drv);
}

Expand Down

0 comments on commit 2b941a5

Please sign in to comment.