@@ -431,24 +431,23 @@ static int sis630_setup(struct pci_dev *sis630_dev)
in acpi io space and read acpi base addr
*/
if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, &b)) {
- dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n");
- retval = -ENODEV;
+ retval = dev_err_probe(&sis630_dev->dev, -ENODEV,
+ "Error: Can't read bios ctl reg\n");
goto exit;
}
/* if ACPI already enabled , do nothing */
if (!(b & 0x80) &&
pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) {
- dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n");
- retval = -ENODEV;
+ retval = dev_err_probe(&sis630_dev->dev, -ENODEV,
+ "Error: Can't enable ACPI\n");
goto exit;
}
/* Determine the ACPI base address */
if (pci_read_config_word(sis630_dev,
SIS630_ACPI_BASE_REG, &acpi_base)) {
- dev_err(&sis630_dev->dev,
- "Error: Can't determine ACPI base address\n");
- retval = -ENODEV;
+ retval = dev_err_probe(&sis630_dev->dev, -ENODEV,
+ "Error: Can't determine ACPI base address\n");
goto exit;
}
@@ -469,11 +468,10 @@ static int sis630_setup(struct pci_dev *sis630_dev)
/* Everything is happy, let's grab the memory and set things up. */
if (!request_region(smbus_base + SMB_STS, SIS630_SMB_IOREGION,
sis630_driver.name)) {
- dev_err(&sis630_dev->dev,
- "I/O Region 0x%04x-0x%04x for SMBus already in use.\n",
- smbus_base + SMB_STS,
- smbus_base + SMB_STS + SIS630_SMB_IOREGION - 1);
- retval = -EBUSY;
+ retval = dev_err_probe(&sis630_dev->dev, -EBUSY,
+ "I/O Region 0x%04x-0x%04x for SMBus already in use.\n",
+ smbus_base + SMB_STS,
+ smbus_base + SMB_STS + SIS630_SMB_IOREGION - 1);
goto exit;
}
@@ -511,12 +509,9 @@ static int sis630_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
int ret;
- if (sis630_setup(dev)) {
- dev_err(&dev->dev,
- "SIS630 compatible bus not detected, "
- "module not inserted.\n");
- return -ENODEV;
- }
+ if (sis630_setup(dev))
+ return dev_err_probe(&dev->dev, -ENODEV,
+ "Compatible bus not detected, module not inserted.\n");
/* set up the sysfs linkage to our parent device */
sis630_adapter.dev.parent = &dev->dev;
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> --- drivers/i2c/busses/i2c-sis630.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-)