mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
i2c: sis630: Replace dev_err() with dev_err_probe() in probe function
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20250520194400.341079-11-e.zanda1@gmail.com
This commit is contained in:
parent
9013a0c9ba
commit
b371250b98
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user