]> git.itanic.dy.fi Git - linux-stable/commitdiff
i2c: nforce2: Do PCI error check on own line
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 24 Aug 2023 13:28:26 +0000 (16:28 +0300)
committerWolfram Sang <wsa@kernel.org>
Fri, 25 Aug 2023 20:11:08 +0000 (22:11 +0200)
Instead of a if condition with a line split, use the usual error
handling pattern with a separate variable to improve readability.

No functional changes intended.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-nforce2.c

index 777278386f58eb1904a042c3f896ce1e7a6ba32b..38d203d93eeec4bde521ddb034a1e4bd1fc88da0 100644 (file)
@@ -327,8 +327,8 @@ static int nforce2_probe_smb(struct pci_dev *dev, int bar, int alt_reg,
                /* Older incarnations of the device used non-standard BARs */
                u16 iobase;
 
-               if (pci_read_config_word(dev, alt_reg, &iobase)
-                   != PCIBIOS_SUCCESSFUL) {
+               error = pci_read_config_word(dev, alt_reg, &iobase);
+               if (error != PCIBIOS_SUCCESSFUL) {
                        dev_err(&dev->dev, "Error reading PCI config for %s\n",
                                name);
                        return -EIO;