summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_si_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_pci.c')
-rw-r--r--drivers/char/ipmi/ipmi_si_pci.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/char/ipmi/ipmi_si_pci.c b/drivers/char/ipmi/ipmi_si_pci.c
index 95bbcfba5408..74fa2055868b 100644
--- a/drivers/char/ipmi/ipmi_si_pci.c
+++ b/drivers/char/ipmi/ipmi_si_pci.c
@@ -16,18 +16,11 @@ static bool pci_registered;
static bool si_trypci = true;
module_param_named(trypci, si_trypci, bool, 0);
-MODULE_PARM_DESC(trypci, "Setting this to zero will disable the"
- " default scan of the interfaces identified via pci");
+MODULE_PARM_DESC(trypci,
+ "Setting this to zero will disable the default scan of the interfaces identified via pci");
#define PCI_DEVICE_ID_HP_MMC 0x121A
-static void ipmi_pci_cleanup(struct si_sm_io *io)
-{
- struct pci_dev *pdev = io->addr_source_data;
-
- pci_disable_device(pdev);
-}
-
static int ipmi_pci_probe_regspacing(struct si_sm_io *io)
{
if (io->si_type == SI_KCS) {
@@ -97,15 +90,12 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
return -ENOMEM;
}
- rv = pci_enable_device(pdev);
+ rv = pcim_enable_device(pdev);
if (rv) {
dev_err(&pdev->dev, "couldn't enable PCI device\n");
return rv;
}
- io.addr_source_cleanup = ipmi_pci_cleanup;
- io.addr_source_data = pdev;
-
if (pci_resource_flags(pdev, 0) & IORESOURCE_IO) {
io.addr_space = IPMI_IO_ADDR_SPACE;
io.io_setup = ipmi_si_port_setup;
@@ -128,11 +118,7 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
dev_info(&pdev->dev, "%pR regsize %d spacing %d irq %d\n",
&pdev->resource[0], io.regsize, io.regspacing, io.irq);
- rv = ipmi_si_add_smi(&io);
- if (rv)
- pci_disable_device(pdev);
-
- return rv;
+ return ipmi_si_add_smi(&io);
}
static void ipmi_pci_remove(struct pci_dev *pdev)