Skip to content

Commit 65cba48

Browse files
Philipp StannerAndi Shyti
authored andcommitted
i2c: i801: Remove unnecessary PCI function call
Since the changes in commit f748a07 ("PCI: Remove legacy pcim_release()") all pcim_enable_device() does is set up a callback that disables the device from being disabled from driver detach. The function pcim_pin_device() prevents said disabling. pcim_enable_device(), therefore, sets up an action that is removed immediately afterwards by pcim_pin_device(). Replace pcim_enable_device() with pci_enable_device() and remove the unnecessary call to pcim_pin_device(). Signed-off-by: Philipp Stanner <pstanner@redhat.com> Link: https://lore.kernel.org/r/20241121195624.144839-2-pstanner@redhat.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 4262df2 commit 65cba48

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/i2c/busses/i2c-i801.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,13 +1682,16 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
16821682
if (!(priv->features & FEATURE_BLOCK_BUFFER))
16831683
priv->features &= ~FEATURE_BLOCK_PROC;
16841684

1685-
err = pcim_enable_device(dev);
1685+
/*
1686+
* Do not call pcim_enable_device(), because the device has to remain
1687+
* enabled on driver detach. See i801_remove() for the reasoning.
1688+
*/
1689+
err = pci_enable_device(dev);
16861690
if (err) {
16871691
dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n",
16881692
err);
16891693
return err;
16901694
}
1691-
pcim_pin_device(dev);
16921695

16931696
/* Determine the address of the SMBus area */
16941697
priv->smba = pci_resource_start(dev, SMBBAR);

0 commit comments

Comments
 (0)