Skip to content

Commit 0dc6047

Browse files
committed
i2c: i801: Remove unnecessary PCI function call
JIRA: https://issues.redhat.com/browse/RHEL-47426 commit 65cba48 Author: Philipp Stanner <[email protected]> Date: Thu Nov 21 20:56:25 2024 +0100 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andi Shyti <[email protected]> Signed-off-by: David Arcari <[email protected]>
1 parent f5ed44b commit 0dc6047

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
@@ -1558,13 +1558,16 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
15581558
if (!(priv->features & FEATURE_BLOCK_BUFFER))
15591559
priv->features &= ~FEATURE_BLOCK_PROC;
15601560

1561-
err = pcim_enable_device(dev);
1561+
/*
1562+
* Do not call pcim_enable_device(), because the device has to remain
1563+
* enabled on driver detach. See i801_remove() for the reasoning.
1564+
*/
1565+
err = pci_enable_device(dev);
15621566
if (err) {
15631567
dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n",
15641568
err);
15651569
return err;
15661570
}
1567-
pcim_pin_device(dev);
15681571

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

0 commit comments

Comments
 (0)