From: Jean Delvare Date: Tue, 1 Sep 2020 13:28:37 +0000 (+0200) Subject: i2c: i801: Simplify the suspend callback X-Git-Tag: v5.9-rc6~15^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=811a6e18a8633ef66c6c9bad09f359dd9daa9ec1;p=thirdparty%2Fkernel%2Flinux.git i2c: i801: Simplify the suspend callback We don't actually need to derive the PCI device from the device structure, as we already have a pointer to it in our private data structure. Signed-off-by: Jean Delvare Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 22597fa415f1d..ebb4c0b03057d 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1958,10 +1958,9 @@ static void i801_shutdown(struct pci_dev *dev) #ifdef CONFIG_PM_SLEEP static int i801_suspend(struct device *dev) { - struct pci_dev *pci_dev = to_pci_dev(dev); - struct i801_priv *priv = pci_get_drvdata(pci_dev); + struct i801_priv *priv = dev_get_drvdata(dev); - pci_write_config_byte(pci_dev, SMBHSTCFG, priv->original_hstcfg); + pci_write_config_byte(priv->pci_dev, SMBHSTCFG, priv->original_hstcfg); return 0; }