Skip to content

Commit 1da18b3

Browse files
ij-intelwsakernel
authored andcommitted
i2c: sis5595: Do PCI error checks on own line
Instead of if conditions with line splits, use the usual error handling pattern with a separate variable to improve readability. No functional changes intended. Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 7f2e65a commit 1da18b3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

drivers/i2c/busses/i2c-sis5595.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev)
175175

176176
if (force_addr) {
177177
dev_info(&SIS5595_dev->dev, "forcing ISA address 0x%04X\n", sis5595_base);
178-
if (pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base)
179-
!= PCIBIOS_SUCCESSFUL)
178+
retval = pci_write_config_word(SIS5595_dev, ACPI_BASE, sis5595_base);
179+
if (retval != PCIBIOS_SUCCESSFUL)
180180
goto error;
181-
if (pci_read_config_word(SIS5595_dev, ACPI_BASE, &a)
182-
!= PCIBIOS_SUCCESSFUL)
181+
retval = pci_read_config_word(SIS5595_dev, ACPI_BASE, &a);
182+
if (retval != PCIBIOS_SUCCESSFUL)
183183
goto error;
184184
if ((a & ~(SIS5595_EXTENT - 1)) != sis5595_base) {
185185
/* doesn't work for some chips! */
@@ -188,16 +188,16 @@ static int sis5595_setup(struct pci_dev *SIS5595_dev)
188188
}
189189
}
190190

191-
if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)
192-
!= PCIBIOS_SUCCESSFUL)
191+
retval = pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val);
192+
if (retval != PCIBIOS_SUCCESSFUL)
193193
goto error;
194194
if ((val & 0x80) == 0) {
195195
dev_info(&SIS5595_dev->dev, "enabling ACPI\n");
196-
if (pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80)
197-
!= PCIBIOS_SUCCESSFUL)
196+
retval = pci_write_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, val | 0x80);
197+
if (retval != PCIBIOS_SUCCESSFUL)
198198
goto error;
199-
if (pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val)
200-
!= PCIBIOS_SUCCESSFUL)
199+
retval = pci_read_config_byte(SIS5595_dev, SIS5595_ENABLE_REG, &val);
200+
if (retval != PCIBIOS_SUCCESSFUL)
201201
goto error;
202202
if ((val & 0x80) == 0) {
203203
/* doesn't work for some chips? */

0 commit comments

Comments
 (0)