Commit 600ca080 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang

i2c: ismt: improve usage of devres API

pcim_release() will release any requested region. There is no need to duplicate
this effort in the driver.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 6109dbd6
...@@ -904,8 +904,7 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -904,8 +904,7 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id)
priv->smba = pcim_iomap(pdev, SMBBAR, len); priv->smba = pcim_iomap(pdev, SMBBAR, len);
if (!priv->smba) { if (!priv->smba) {
dev_err(&pdev->dev, "Unable to ioremap SMBus BAR\n"); dev_err(&pdev->dev, "Unable to ioremap SMBus BAR\n");
err = -ENODEV; return -ENODEV;
goto fail;
} }
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) || if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) ||
...@@ -915,32 +914,26 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -915,32 +914,26 @@ ismt_probe(struct pci_dev *pdev, const struct pci_device_id *id)
DMA_BIT_MASK(32)) != 0)) { DMA_BIT_MASK(32)) != 0)) {
dev_err(&pdev->dev, "pci_set_dma_mask fail %p\n", dev_err(&pdev->dev, "pci_set_dma_mask fail %p\n",
pdev); pdev);
err = -ENODEV; return -ENODEV;
goto fail;
} }
} }
err = ismt_dev_init(priv); err = ismt_dev_init(priv);
if (err) if (err)
goto fail; return err;
ismt_hw_init(priv); ismt_hw_init(priv);
err = ismt_int_init(priv); err = ismt_int_init(priv);
if (err) if (err)
goto fail; return err;
err = i2c_add_adapter(&priv->adapter); err = i2c_add_adapter(&priv->adapter);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to add SMBus iSMT adapter\n"); dev_err(&pdev->dev, "Failed to add SMBus iSMT adapter\n");
err = -ENODEV; return -ENODEV;
goto fail;
} }
return 0; return 0;
fail:
pci_release_region(pdev, SMBBAR);
return err;
} }
/** /**
...@@ -952,7 +945,6 @@ static void ismt_remove(struct pci_dev *pdev) ...@@ -952,7 +945,6 @@ static void ismt_remove(struct pci_dev *pdev)
struct ismt_priv *priv = pci_get_drvdata(pdev); struct ismt_priv *priv = pci_get_drvdata(pdev);
i2c_del_adapter(&priv->adapter); i2c_del_adapter(&priv->adapter);
pci_release_region(pdev, SMBBAR);
} }
/** /**
......
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