Commit 5e15a753 authored by Jens Taprogge's avatar Jens Taprogge Committed by Greg Kroah-Hartman

Staging: ipack/bridges/tpci200: Reorganize tpci200_probe in preparation for functional changes.

These changes make it easier to add more initialization steps later on.
Signed-off-by: default avatarJens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7cd4e8c5
...@@ -790,8 +790,8 @@ static int tpci200_pciprobe(struct pci_dev *pdev, ...@@ -790,8 +790,8 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL); tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL);
if (!tpci200->info) { if (!tpci200->info) {
kfree(tpci200); ret = -ENOMEM;
return -ENOMEM; goto out_err_info;
} }
/* Save struct pci_dev pointer */ /* Save struct pci_dev pointer */
...@@ -801,10 +801,9 @@ static int tpci200_pciprobe(struct pci_dev *pdev, ...@@ -801,10 +801,9 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
/* register the device and initialize it */ /* register the device and initialize it */
ret = tpci200_install(tpci200); ret = tpci200_install(tpci200);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Error during tpci200 install !\n"); dev_err(&pdev->dev, "error during tpci200 install\n");
kfree(tpci200->info); ret = -ENODEV;
kfree(tpci200); goto out_err_install;
return -ENODEV;
} }
/* Register the carrier in the industry pack bus driver */ /* Register the carrier in the industry pack bus driver */
...@@ -814,10 +813,8 @@ static int tpci200_pciprobe(struct pci_dev *pdev, ...@@ -814,10 +813,8 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
if (!tpci200->info->ipack_bus) { if (!tpci200->info->ipack_bus) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"error registering the carrier on ipack driver\n"); "error registering the carrier on ipack driver\n");
tpci200_uninstall(tpci200); ret = -EFAULT;
kfree(tpci200->info); goto out_err_bus_register;
kfree(tpci200);
return -EFAULT;
} }
/* save the bus number given by ipack to logging purpose */ /* save the bus number given by ipack to logging purpose */
...@@ -831,6 +828,14 @@ static int tpci200_pciprobe(struct pci_dev *pdev, ...@@ -831,6 +828,14 @@ static int tpci200_pciprobe(struct pci_dev *pdev,
for (i = 0; i < TPCI200_NB_SLOT; i++) for (i = 0; i < TPCI200_NB_SLOT; i++)
tpci200->slots[i].dev = tpci200->slots[i].dev =
ipack_device_register(tpci200->info->ipack_bus, i, i); ipack_device_register(tpci200->info->ipack_bus, i, i);
return 0;
out_err_bus_register:
tpci200_uninstall(tpci200);
out_err_install:
kfree(tpci200->info);
out_err_info:
kfree(tpci200);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment