Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: via: 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>
Link: https://lore.kernel.org/r/20250415183447.396277-4-e.zanda1@gmail.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Enrico Zanda and committed by
Andi Shyti
05ac621b c4f62651

+7 -8
+7 -8
drivers/i2c/busses/i2c-via.c
··· 89 89 u8 rev; 90 90 int res; 91 91 92 - if (pm_io_base) { 93 - dev_err(&dev->dev, "i2c-via: Will only support one host\n"); 94 - return -ENODEV; 95 - } 92 + if (pm_io_base) 93 + return dev_err_probe(&dev->dev, -ENODEV, 94 + "Will only support one host\n"); 96 95 97 96 pci_read_config_byte(dev, PM_CFG_REVID, &rev); 98 97 ··· 112 113 pci_read_config_word(dev, base, &pm_io_base); 113 114 pm_io_base &= (0xff << 8); 114 115 115 - if (!request_region(I2C_DIR, IOSPACE, vt586b_driver.name)) { 116 - dev_err(&dev->dev, "IO 0x%x-0x%x already in use\n", I2C_DIR, I2C_DIR + IOSPACE); 117 - return -ENODEV; 118 - } 116 + if (!request_region(I2C_DIR, IOSPACE, vt586b_driver.name)) 117 + return dev_err_probe(&dev->dev, -ENODEV, 118 + "IO 0x%x-0x%x already in use\n", 119 + I2C_DIR, I2C_DIR + IOSPACE); 119 120 120 121 outb(inb(I2C_DIR) & ~(I2C_SDA | I2C_SCL), I2C_DIR); 121 122 outb(inb(I2C_OUT) & ~(I2C_SDA | I2C_SCL), I2C_OUT);