hwmon: (via686a) 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 <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230824132832.78705-6-ilpo.jarvinen@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Ilpo Järvinen
2023-08-24 16:28:23 +03:00
committed by Guenter Roeck
parent e7593bda6a
commit 70332ec735

View File

@@ -855,16 +855,17 @@ static int via686a_pci_probe(struct pci_dev *dev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
u16 address, val; u16 address, val;
int ret;
if (force_addr) { if (force_addr) {
address = force_addr & ~(VIA686A_EXTENT - 1); address = force_addr & ~(VIA686A_EXTENT - 1);
dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address); dev_warn(&dev->dev, "Forcing ISA address 0x%x\n", address);
if (PCIBIOS_SUCCESSFUL != ret = pci_write_config_word(dev, VIA686A_BASE_REG, address | 1);
pci_write_config_word(dev, VIA686A_BASE_REG, address | 1)) if (ret != PCIBIOS_SUCCESSFUL)
return -ENODEV; return -ENODEV;
} }
if (PCIBIOS_SUCCESSFUL != ret = pci_read_config_word(dev, VIA686A_BASE_REG, &val);
pci_read_config_word(dev, VIA686A_BASE_REG, &val)) if (ret != PCIBIOS_SUCCESSFUL)
return -ENODEV; return -ENODEV;
address = val & ~(VIA686A_EXTENT - 1); address = val & ~(VIA686A_EXTENT - 1);
@@ -874,8 +875,8 @@ static int via686a_pci_probe(struct pci_dev *dev,
return -ENODEV; return -ENODEV;
} }
if (PCIBIOS_SUCCESSFUL != ret = pci_read_config_word(dev, VIA686A_ENABLE_REG, &val);
pci_read_config_word(dev, VIA686A_ENABLE_REG, &val)) if (ret != PCIBIOS_SUCCESSFUL)
return -ENODEV; return -ENODEV;
if (!(val & 0x0001)) { if (!(val & 0x0001)) {
if (!force_addr) { if (!force_addr) {
@@ -886,9 +887,8 @@ static int via686a_pci_probe(struct pci_dev *dev,
} }
dev_warn(&dev->dev, "Enabling sensors\n"); dev_warn(&dev->dev, "Enabling sensors\n");
if (PCIBIOS_SUCCESSFUL != ret = pci_write_config_word(dev, VIA686A_ENABLE_REG, val | 0x1);
pci_write_config_word(dev, VIA686A_ENABLE_REG, if (ret != PCIBIOS_SUCCESSFUL)
val | 0x0001))
return -ENODEV; return -ENODEV;
} }