i2c: i801: Remove unnecessary PCI function call
PATCH 1/1 i2c: i801: Remove unnecessary PCI function call
Since the changes in
commit f748a07a0b64 ("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().
--- drivers/i2c/busses/i2c-i801.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-i801.c +5 -2
@@ -1676,13 +1676,16 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)if (!(priv->features &FEATURE_BLOCK_BUFFER )) priv->features &= ~FEATURE_BLOCK_PROC ; - err =pcim_enable_device (dev); +/* +* Do not call pcim_enable_device(), because the device has to remain +* enabled on driver detach. See i801_remove() for the reasoning. +*/ + err =pci_enable_device (dev);if (err) {dev_err (&dev->dev,"Failed to enable SMBus PCI device (%d)\n" , err);return err; } -pcim_pin_device (dev);/* Determine the address of the SMBus area */ priv->smba =pci_resource_start (dev,SMBBAR );
Signature · 1 line
2.47.0
Andi Shyti
maintainerHi Philipp,
Quoted 10 lines · Philipp Stanner
Since the changes in
commit f748a07a0b64 ("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 functionpcim_pin_device()prevents said disabling.pcim_enable_device(), therefore, sets up an action that is removed immediately afterwards bypcim_pin_device().
Quoted 4 lines
Replace
pcim_enable_device()withpci_enable_device()and remove the unnecessary call topcim_pin_device().Signed-off-by Philipp Stanner <[email protected]>
nice cleanup, merged to i2c/i2c-host.
Thanks,
Andi