Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: i801: Improve i801_setup_hstcfg

i801_setup_hstcfg() leaves the bits in priv->original_hstcfg that
we're interested in intact. Therefore we can remove the return value
from the function and use priv->original_hstcfg directly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

authored by

Heiner Kallweit and committed by
Wolfram Sang
c601610c d4a994f6

+4 -6
+4 -6
drivers/i2c/busses/i2c-i801.c
··· 1684 1684 static inline void i801_acpi_remove(struct i801_priv *priv) { } 1685 1685 #endif 1686 1686 1687 - static unsigned char i801_setup_hstcfg(struct i801_priv *priv) 1687 + static void i801_setup_hstcfg(struct i801_priv *priv) 1688 1688 { 1689 1689 unsigned char hstcfg = priv->original_hstcfg; 1690 1690 1691 1691 hstcfg &= ~SMBHSTCFG_I2C_EN; /* SMBus timing */ 1692 1692 hstcfg |= SMBHSTCFG_HST_EN; 1693 1693 pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg); 1694 - return hstcfg; 1695 1694 } 1696 1695 1697 1696 static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id) 1698 1697 { 1699 - unsigned char temp; 1700 1698 int err, i; 1701 1699 struct i801_priv *priv; 1702 1700 ··· 1816 1818 } 1817 1819 1818 1820 pci_read_config_byte(priv->pci_dev, SMBHSTCFG, &priv->original_hstcfg); 1819 - temp = i801_setup_hstcfg(priv); 1821 + i801_setup_hstcfg(priv); 1820 1822 if (!(priv->original_hstcfg & SMBHSTCFG_HST_EN)) 1821 1823 dev_info(&dev->dev, "Enabling SMBus device\n"); 1822 1824 1823 - if (temp & SMBHSTCFG_SMB_SMI_EN) { 1825 + if (priv->original_hstcfg & SMBHSTCFG_SMB_SMI_EN) { 1824 1826 dev_dbg(&dev->dev, "SMBus using interrupt SMI#\n"); 1825 1827 /* Disable SMBus interrupt feature if SMBus using SMI# */ 1826 1828 priv->features &= ~FEATURE_IRQ; 1827 1829 } 1828 - if (temp & SMBHSTCFG_SPD_WD) 1830 + if (priv->original_hstcfg & SMBHSTCFG_SPD_WD) 1829 1831 dev_info(&dev->dev, "SPD Write Disable is set\n"); 1830 1832 1831 1833 /* Clear special mode bits */