Skip to content

Commit e23e610

Browse files
ij-intelwsakernel
authored andcommitted
I2C: ali15x3: 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 c8930ed commit e23e610

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/i2c/busses/i2c-ali15x3.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,15 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev)
165165
}
166166

167167
if(force_addr) {
168+
int ret;
169+
168170
dev_info(&ALI15X3_dev->dev, "forcing ISA address 0x%04X\n",
169171
ali15x3_smba);
170-
if (PCIBIOS_SUCCESSFUL != pci_write_config_word(ALI15X3_dev,
171-
SMBBA,
172-
ali15x3_smba))
172+
ret = pci_write_config_word(ALI15X3_dev, SMBBA, ali15x3_smba);
173+
if (ret != PCIBIOS_SUCCESSFUL)
173174
goto error;
174-
if (PCIBIOS_SUCCESSFUL != pci_read_config_word(ALI15X3_dev,
175-
SMBBA, &a))
175+
ret = pci_read_config_word(ALI15X3_dev, SMBBA, &a);
176+
if (ret != PCIBIOS_SUCCESSFUL)
176177
goto error;
177178
if ((a & ~(ALI15X3_SMB_IOSIZE - 1)) != ali15x3_smba) {
178179
/* make sure it works */

0 commit comments

Comments
 (0)