Skip to contentSkip to conversation

i2c: Replace dev_err() with dev_err_probe()

PATCH Applied Enrico Zanda 2 participants 18 messages Apr 15, 2025 – May 13, 2025

Subsystems (7)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover i2c: Replace dev_err() with dev_err_probe()

This patch series replaces dev_err() with dev_err_probe() in the probe() functions of each module.
This simplifies the code and improves logs.

Enrico Zanda (10):
i2c: uniphier(-f): Replace dev_err() with dev_err_probe() in probe
function
i2c: uniphier: Replace dev_err() with dev_err_probe() in probe
function
i2c: via: Replace dev_err() with dev_err_probe() in probe function
i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe
function
i2c: viapro: Replace dev_err() with dev_err_probe() in probe function
i2c: viperboard: Replace dev_err() with dev_err_probe() in probe
function
i2c: virtio: Replace dev_err() with dev_err_probe() in probe function
i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe
function
i2c: i2c-xiic: Replace dev_err() with dev_err_probe() in probe
function
i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe
function

 drivers/i2c/busses/i2c-uniphier-f.c    | 24 +++++++------------
 drivers/i2c/busses/i2c-uniphier.c      | 24 +++++++------------
 drivers/i2c/busses/i2c-via.c           | 15 ++++++------
 drivers/i2c/busses/i2c-viai2c-wmt.c    | 13 ++++------
 drivers/i2c/busses/i2c-viapro.c        | 33 ++++++++++++--------------
 drivers/i2c/busses/i2c-viperboard.c    | 14 +++++------
 drivers/i2c/busses/i2c-virtio.c        |  7 +++---
 drivers/i2c/busses/i2c-xgene-slimpro.c | 27 ++++++++++-----------
 drivers/i2c/busses/i2c-xiic.c          |  4 ++--
 drivers/i2c/busses/scx200_acb.c        |  6 ++---
 10 files changed, 68 insertions(+), 99 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/10 i2c: uniphier(-f): Replace dev_err() with dev_err_probe() in probe function

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-uniphier-f.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)
drivers/i2c/busses/i2c-uniphier-f.c +8 -16
index d877f5a1f579..ca0358e8f928 100644
@@ -532,22 +532,16 @@ static int uniphier_fi2c_probe(struct platform_device *pdev)
 	if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed))
 		bus_speed = I2C_MAX_STANDARD_MODE_FREQ;
 
-	if (!bus_speed || bus_speed > I2C_MAX_FAST_MODE_FREQ) {
-		dev_err(dev, "invalid clock-frequency %d\n", bus_speed);
-		return -EINVAL;
-	}
+	if (!bus_speed || bus_speed > I2C_MAX_FAST_MODE_FREQ)
+		return dev_err_probe(dev, -EINVAL, "invalid clock-frequency %d\n", bus_speed);
 
 	priv->clk = devm_clk_get_enabled(dev, NULL);
-	if (IS_ERR(priv->clk)) {
-		dev_err(dev, "failed to enable clock\n");
-		return PTR_ERR(priv->clk);
-	}
+	if (IS_ERR(priv->clk))
+		return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to enable clock\n");
 
 	clk_rate = clk_get_rate(priv->clk);
-	if (!clk_rate) {
-		dev_err(dev, "input clock rate should not be zero\n");
-		return -EINVAL;
-	}
+	if (!clk_rate)
+		return dev_err_probe(dev, -EINVAL, "input clock rate should not be zero\n");
 
 	priv->clk_cycle = clk_rate / bus_speed;
 	init_completion(&priv->comp);
@@ -565,10 +559,8 @@ static int uniphier_fi2c_probe(struct platform_device *pdev)
 
 	ret = devm_request_irq(dev, irq, uniphier_fi2c_interrupt, 0,
 			       pdev->name, priv);
-	if (ret) {
-		dev_err(dev, "failed to request irq %d\n", irq);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
 
 	return i2c_add_adapter(&priv->adap);
 }
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/10 i2c: uniphier: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-uniphier.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)
drivers/i2c/busses/i2c-uniphier.c +8 -16
index b95d50d4d7db..9d49a3d5d612 100644
@@ -327,22 +327,16 @@ static int uniphier_i2c_probe(struct platform_device *pdev)
 	if (of_property_read_u32(dev->of_node, "clock-frequency", &bus_speed))
 		bus_speed = I2C_MAX_STANDARD_MODE_FREQ;
 
-	if (!bus_speed || bus_speed > I2C_MAX_FAST_MODE_FREQ) {
-		dev_err(dev, "invalid clock-frequency %d\n", bus_speed);
-		return -EINVAL;
-	}
+	if (!bus_speed || bus_speed > I2C_MAX_FAST_MODE_FREQ)
+		return dev_err_probe(dev, -EINVAL, "invalid clock-frequency %d\n", bus_speed);
 
 	priv->clk = devm_clk_get_enabled(dev, NULL);
-	if (IS_ERR(priv->clk)) {
-		dev_err(dev, "failed to enable clock\n");
-		return PTR_ERR(priv->clk);
-	}
+	if (IS_ERR(priv->clk))
+		return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to enable clock\n");
 
 	clk_rate = clk_get_rate(priv->clk);
-	if (!clk_rate) {
-		dev_err(dev, "input clock rate should not be zero\n");
-		return -EINVAL;
-	}
+	if (!clk_rate)
+		return dev_err_probe(dev, -EINVAL, "input clock rate should not be zero\n");
 
 	priv->clk_cycle = clk_rate / bus_speed;
 	init_completion(&priv->comp);
@@ -359,10 +353,8 @@ static int uniphier_i2c_probe(struct platform_device *pdev)
 
 	ret = devm_request_irq(dev, irq, uniphier_i2c_interrupt, 0, pdev->name,
 			       priv);
-	if (ret) {
-		dev_err(dev, "failed to request irq %d\n", irq);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to request irq %d\n", irq);
 
 	return i2c_add_adapter(&priv->adap);
 }
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/10 i2c: via: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-via.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-via.c +7 -8
index 7ed29992a97f..2de73fda6613 100644
@@ -89,10 +89,9 @@ static int vt586b_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	u8 rev;
 	int res;
 
-	if (pm_io_base) {
-		dev_err(&dev->dev, "i2c-via: Will only support one host\n");
-		return -ENODEV;
-	}
+	if (pm_io_base)
+		return dev_err_probe(&dev->dev, -ENODEV,
+				     "i2c-via: Will only support one host\n");
 
 	pci_read_config_byte(dev, PM_CFG_REVID, &rev);
 
@@ -113,10 +112,10 @@ static int vt586b_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	pci_read_config_word(dev, base, &pm_io_base);
 	pm_io_base &= (0xff << 8);
 
-	if (!request_region(I2C_DIR, IOSPACE, vt586b_driver.name)) {
-		dev_err(&dev->dev, "IO 0x%x-0x%x already in use\n", I2C_DIR, I2C_DIR + IOSPACE);
-		return -ENODEV;
-	}
+	if (!request_region(I2C_DIR, IOSPACE, vt586b_driver.name))
+		return dev_err_probe(&dev->dev, -ENODEV,
+				     "IO 0x%x-0x%x already in use\n",
+				     I2C_DIR, I2C_DIR + IOSPACE);
 
 	outb(inb(I2C_DIR) & ~(I2C_SDA | I2C_SCL), I2C_DIR);
 	outb(inb(I2C_OUT) & ~(I2C_SDA | I2C_SCL), I2C_OUT);
Signature · 1 line
2.43.0
maintainer
#4 lore raw

Re: [PATCH 03/10] i2c: via: Replace dev_err() with dev_err_probe() in probe function

Hi Enrico,

drivers/i2c/busses/i2c-via.c static int vt586b_probe(struct pci_dev *dev, const struct pci_device_id *id) · line 94

Quoted 11 lines
drivers/i2c/busses/i2c-via.c +3 -4
@@ -89,10 +89,9 @@ static int vt586b_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	u8 rev;
 	int res;
 
-	if (pm_io_base) {
-		dev_err(&dev->dev, "i2c-via: Will only support one host\n");
-		return -ENODEV;
-	}
+	if (pm_io_base)
+		return dev_err_probe(&dev->dev, -ENODEV,
+				     "i2c-via: Will only support one host\n");

as we are here, you can remove the "i2c-via" because dev_err already prints the device and I don't see any useful information coming from it.

Thanks,
Andi

#5 lore raw

PATCH 4/10 i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-viai2c-wmt.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-viai2c-wmt.c +5 -8
index 4eb740faf268..be23dddf8bde 100644
@@ -121,10 +121,9 @@ static int wmt_i2c_probe(struct platform_device *pdev)
 				"failed to request irq %i\n", i2c->irq);
 
 	i2c->clk = of_clk_get(np, 0);
-	if (IS_ERR(i2c->clk)) {
-		dev_err(&pdev->dev, "unable to request clock\n");
-		return PTR_ERR(i2c->clk);
-	}
+	if (IS_ERR(i2c->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
+				     "unable to request clock\n");
 
 	err = of_property_read_u32(np, "clock-frequency", &clk_rate);
 	if (!err && clk_rate == I2C_MAX_FAST_MODE_FREQ)
@@ -139,10 +138,8 @@ static int wmt_i2c_probe(struct platform_device *pdev)
 	adap->dev.of_node = pdev->dev.of_node;
 
 	err = wmt_i2c_reset_hardware(i2c);
-	if (err) {
-		dev_err(&pdev->dev, "error initializing hardware\n");
-		return err;
-	}
+	if (err)
+		return dev_err_probe(&pdev->dev, err, "error initializing hardware\n");
 
 	err = i2c_add_adapter(adap);
 	if (err)
Signature · 1 line
2.43.0
maintainer
#6 lore raw

Re: [PATCH 04/10] i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe function

Hi Enrico,

...

drivers/i2c/busses/i2c-viai2c-wmt.c static int wmt_i2c_probe(struct platform_device *pdev) · line 140

Quoted 4 lines
drivers/i2c/busses/i2c-viai2c-wmt.c +0 -0
@@ -139,10 +138,8 @@ static int wmt_i2c_probe(struct platform_device *pdev)
 	adap->dev.of_node = pdev->dev.of_node;
 
 	err = wmt_i2c_reset_hardware(i2c);

reset hardware is only called by the probe, so that inside reset hardware we could alraedy use dev_err_probe() and...

drivers/i2c/busses/i2c-viai2c-wmt.c static int wmt_i2c_probe(struct platform_device *pdev) · line 143

Quoted 2 lines
drivers/i2c/busses/i2c-viai2c-wmt.c +0 -2
-	if (err) {
-		dev_err(&pdev->dev, "error initializing hardware\n");

just remove this printout which is redundant.

Andi

Quoted 10 lines
drivers/i2c/busses/i2c-viai2c-wmt.c +2 -2
-		return err;
-	}
+	if (err)
+		return dev_err_probe(&pdev->dev, err, "error initializing hardware\n");
 
 	err = i2c_add_adapter(adap);
 	if (err)
Signature · 1 line
2.43.0
#7 lore raw

Re: [PATCH 04/10] i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe function

Hi Andi,

Quoted 5 lines · Andi Shyti

reset hardware is only called by the probe, so that inside reset hardware we could alraedy use dev_err_probe() and...

just remove this printout which is redundant.

I will apply the suggested changes in the new version.

Thanks,
Enrico

#8 lore raw

PATCH 5/10 i2c: viapro: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-viapro.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)
drivers/i2c/busses/i2c-viapro.c +15 -18
index 2cc7bba3b8bf..c58843609107 100644
@@ -330,30 +330,27 @@ static int vt596_probe(struct pci_dev *pdev,
 			SMBHSTCFG = 0x84;
 		} else {
 			/* no matches at all */
-			dev_err(&pdev->dev, "Cannot configure "
-				"SMBus I/O Base address\n");
-			return -ENODEV;
+			return dev_err_probe(&pdev->dev, -ENODEV,
+					     "Cannot configure "
+					     "SMBus I/O Base address\n");
 		}
 	}
 
 	vt596_smba &= 0xfff0;
-	if (vt596_smba == 0) {
-		dev_err(&pdev->dev, "SMBus base address "
-			"uninitialized - upgrade BIOS or use "
-			"force_addr=0xaddr\n");
-		return -ENODEV;
-	}
+	if (vt596_smba == 0)
+		return dev_err_probe(&pdev->dev, -ENODEV, "SMBus base address "
+				     "uninitialized - upgrade BIOS or use "
+				     "force_addr=0xaddr\n");
 
 found:
 	error = acpi_check_region(vt596_smba, 8, vt596_driver.name);
 	if (error)
 		return -ENODEV;
 
-	if (!request_region(vt596_smba, 8, vt596_driver.name)) {
-		dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n",
-			vt596_smba);
-		return -ENODEV;
-	}
+	if (!request_region(vt596_smba, 8, vt596_driver.name))
+		return dev_err_probe(&pdev->dev, -ENODEV,
+				     "SMBus region 0x%x already in use!\n",
+				     vt596_smba);
 
 	pci_read_config_byte(pdev, SMBHSTCFG, &temp);
 	/* If force_addr is set, we program the new address here. Just to make
@@ -375,10 +372,10 @@ static int vt596_probe(struct pci_dev *pdev,
 			pci_write_config_byte(pdev, SMBHSTCFG, temp | 0x01);
 			dev_info(&pdev->dev, "Enabling SMBus device\n");
 		} else {
-			dev_err(&pdev->dev, "SMBUS: Error: Host SMBus "
-				"controller not enabled! - upgrade BIOS or "
-				"use force=1\n");
-			error = -ENODEV;
+			error = dev_err_probe(&pdev->dev, -ENODEV,
+					      "SMBUS: Error: Host SMBus "
+					      "controller not enabled! - "
+					      "upgrade BIOS or use force=1\n");
 			goto release_region;
 		}
 	}
Signature · 1 line
2.43.0
maintainer
#9 lore raw

Re: [PATCH 05/10] i2c: viapro: Replace dev_err() with dev_err_probe() in probe function

Hi Enrico,

drivers/i2c/busses/i2c-viapro.c static int vt596_probe(struct pci_dev *pdev, · line 335

Quoted 6 lines
drivers/i2c/busses/i2c-viapro.c +3 -3
-			dev_err(&pdev->dev, "Cannot configure "
-				"SMBus I/O Base address\n");
-			return -ENODEV;
+			return dev_err_probe(&pdev->dev, -ENODEV,
+					     "Cannot configure "
+					     "SMBus I/O Base address\n");

these string splittings are a bit ugly, but let's leave them as they are. Just a thought, no action requested.

Thanks,
Andi

#10 lore raw

PATCH 6/10 i2c: viperboard: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-viperboard.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-viperboard.c +6 -8
index 503e2f4d6f84..7523e7c02271 100644
@@ -384,15 +384,13 @@ static int vprbrd_i2c_probe(struct platform_device *pdev)
 			VPRBRD_USB_REQUEST_I2C_FREQ, VPRBRD_USB_TYPE_OUT,
 			0x0000, 0x0000, &vb_i2c->bus_freq_param, 1,
 			VPRBRD_USB_TIMEOUT_MS);
-		if (ret != 1) {
-			dev_err(&pdev->dev, "failure setting i2c_bus_freq to %d\n",
-				i2c_bus_freq);
-			return -EIO;
-		}
+		if (ret != 1)
+			return dev_err_probe(&pdev->dev, -EIO,
+					     "failure setting i2c_bus_freq to %d\n",
+					     i2c_bus_freq);
 	} else {
-		dev_err(&pdev->dev,
-			"invalid i2c_bus_freq setting:%d\n", i2c_bus_freq);
-		return -EIO;
+		return dev_err_probe(&pdev->dev, -EIO,
+				     "invalid i2c_bus_freq setting:%d\n", i2c_bus_freq);
 	}
 
 	vb_i2c->i2c.dev.parent = &pdev->dev;
Signature · 1 line
2.43.0
#11 lore raw

PATCH 7/10 i2c: virtio: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-virtio.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-virtio.c +3 -4
index 2a351f961b89..9b05ff53d3d7 100644
@@ -192,10 +192,9 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
 	struct virtio_i2c *vi;
 	int ret;
 
-	if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST)) {
-		dev_err(&vdev->dev, "Zero-length request feature is mandatory\n");
-		return -EINVAL;
-	}
+	if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST))
+		return dev_err_probe(&vdev->dev, -EINVAL,
+				     "Zero-length request feature is mandatory\n");
 
 	vi = devm_kzalloc(&vdev->dev, sizeof(*vi), GFP_KERNEL);
 	if (!vi)
Signature · 1 line
2.43.0
#12 lore raw

PATCH 8/10 i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-xgene-slimpro.c | 27 ++++++++++++--------------
 1 file changed, 12 insertions(+), 15 deletions(-)
drivers/i2c/busses/i2c-xgene-slimpro.c +12 -15
index 663fe5604dd6..82cad0e9c384 100644
@@ -457,10 +457,9 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
 		cl->tx_block = true;
 		cl->rx_callback = slimpro_i2c_rx_cb;
 		ctx->mbox_chan = mbox_request_channel(cl, MAILBOX_I2C_INDEX);
-		if (IS_ERR(ctx->mbox_chan)) {
-			dev_err(&pdev->dev, "i2c mailbox channel request failed\n");
-			return PTR_ERR(ctx->mbox_chan);
-		}
+		if (IS_ERR(ctx->mbox_chan))
+			return dev_err_probe(&pdev->dev, PTR_ERR(ctx->mbox_chan),
+					     "i2c mailbox channel request failed\n");
 	} else {
 		struct pcc_mbox_chan *pcc_chan;
 		const struct acpi_device_id *acpi_id;
@@ -480,17 +479,16 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
 		cl->tx_block = false;
 		cl->rx_callback = slimpro_i2c_pcc_rx_cb;
 		pcc_chan = pcc_mbox_request_channel(cl, ctx->mbox_idx);
-		if (IS_ERR(pcc_chan)) {
-			dev_err(&pdev->dev, "PCC mailbox channel request failed\n");
-			return PTR_ERR(pcc_chan);
-		}
+		if (IS_ERR(pcc_chan))
+			return dev_err_probe(&pdev->dev, PTR_ERR(pcc_chan),
+					     "PCC mailbox channel request failed\n");
 
 		ctx->pcc_chan = pcc_chan;
 		ctx->mbox_chan = pcc_chan->mchan;
 
 		if (!ctx->mbox_chan->mbox->txdone_irq) {
-			dev_err(&pdev->dev, "PCC IRQ not supported\n");
-			rc = -ENOENT;
+			rc = dev_err_probe(&pdev->dev, -ENOENT,
+					   "PCC IRQ not supported\n");
 			goto mbox_err;
 		}
 
@@ -511,15 +509,14 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
 							pcc_chan->shmem_size,
 							MEMREMAP_WB);
 		} else {
-			dev_err(&pdev->dev, "Failed to get PCC comm region\n");
-			rc = -ENOENT;
+			rc = dev_err_probe(&pdev->dev, -ENOENT,
+					   "Failed to get PCC comm region\n");
 			goto mbox_err;
 		}
 
 		if (!ctx->pcc_comm_addr) {
-			dev_err(&pdev->dev,
-				"Failed to ioremap PCC comm region\n");
-			rc = -ENOMEM;
+			rc = dev_err_probe(&pdev->dev, -ENOMEM,
+				      "Failed to ioremap PCC comm region\n");
 			goto mbox_err;
 		}
 	}
Signature · 1 line
2.43.0
maintainer
#13 lore raw

Re: [PATCH 08/10] i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe function

Hi Enrico,

...

Quoted 7 lines
drivers/i2c/busses/i2c-xgene-slimpro.c +1 -2
@@ -511,15 +509,14 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
 							pcc_chan->shmem_size,
 							MEMREMAP_WB);
 		} else {
-			dev_err(&pdev->dev, "Failed to get PCC comm region\n");
-			rc = -ENOENT;
+			rc = dev_err_probe(&pdev->dev, -ENOENT,

drivers/i2c/busses/i2c-xgene-slimpro.c static int xgene_slimpro_i2c_probe(struct platform_device *pdev) · line 519

Quoted 10 lines
drivers/i2c/busses/i2c-xgene-slimpro.c +3 -3
+					   "Failed to get PCC comm region\n");
 			goto mbox_err;
 		}
 
 		if (!ctx->pcc_comm_addr) {
-			dev_err(&pdev->dev,
-				"Failed to ioremap PCC comm region\n");
-			rc = -ENOMEM;
+			rc = dev_err_probe(&pdev->dev, -ENOMEM,
+				      "Failed to ioremap PCC comm region\n");

these lines were removed by 1dde04276b4d ("i2c: xgene-slimpro:
Simplify PCC shared memory region handling").

Can you please rebase your work on top of my branch:

https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

branch i2c/i2c-host.

Thanks,
Andi

Quoted 6 lines
drivers/i2c/busses/i2c-xgene-slimpro.c +0 -0
 			goto mbox_err;
 		}
 	}
Signature · 1 line
2.43.0
#14 lore raw

Re: [PATCH 08/10] i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe function

Hi Andi,

Quoted 8 lines · Andi Shyti

these lines were removed by 1dde04276b4d ("i2c: xgene-slimpro:
Simplify PCC shared memory region handling").

Can you please rebase your work on top of my branch:

https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

branch i2c/i2c-host.

I will rebase and send a new patch.

Thanks,
Enrico

#15 lore raw

PATCH 9/10 i2c: i2c-xiic: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/i2c-xiic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-xiic.c +2 -2
index dc1e46d834dc..6bc1575cea6c 100644
@@ -1489,7 +1489,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
 					pdev->name, i2c);
 
 	if (ret < 0) {
-		dev_err(&pdev->dev, "Cannot claim IRQ\n");
+		dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
 		goto err_pm_disable;
 	}
 
@@ -1510,7 +1510,7 @@ static int xiic_i2c_probe(struct platform_device *pdev)
 
 	ret = xiic_reinit(i2c);
 	if (ret < 0) {
-		dev_err(&pdev->dev, "Cannot xiic_reinit\n");
+		dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n");
 		goto err_pm_disable;
 	}
 
Signature · 1 line
2.43.0
#16 lore raw

PATCH 10/10 i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe function

In reply to Enrico Zanda

This simplifies the code while improving log.

---
 drivers/i2c/busses/scx200_acb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/i2c/busses/scx200_acb.c +2 -4
index 4d6abd7e92ce..06cf221557f2 100644
@@ -500,10 +500,8 @@ static int scx200_probe(struct platform_device *pdev)
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "can't fetch device resource info\n");
-		return -ENODEV;
-	}
+	if (!res)
+		return dev_err_probe(&pdev->dev, -ENODEV, "can't fetch device resource info\n");
 
 	iface = scx200_create_dev("CS5535", res->start, 0, &pdev->dev);
 	if (!iface)
Signature · 1 line
2.43.0
maintainer Applied
#17 lore raw
In reply to Enrico Zanda

Hi Enrico,

thanks a lot for this cleanup and welcome to the commnuity!

Quoted 3 lines · Enrico Zanda

This patch series replaces dev_err() with dev_err_probe() in the probe() functions of each module.
This simplifies the code and improves logs.

I merged your patches into i2c/i2c-host with some exceptions:

Quoted 6 lines

Enrico Zanda (10):
i2c: uniphier(-f): Replace dev_err() with dev_err_probe() in probe
function
i2c: uniphier: Replace dev_err() with dev_err_probe() in probe
function
i2c: via: Replace dev_err() with dev_err_probe() in probe function

I removed the "i2c-via:" string

Quoted 2 lines

i2c: viai2c-wmt: Replace dev_err() with dev_err_probe() in probe
function

Please resend a v2 of this patch.

Quoted 6 lines

i2c: viapro: Replace dev_err() with dev_err_probe() in probe function
i2c: viperboard: Replace dev_err() with dev_err_probe() in probe
function
i2c: virtio: Replace dev_err() with dev_err_probe() in probe function
i2c: xgene-slimpro: Replace dev_err() with dev_err_probe() in probe
function

Please, rebase and send a v2 of this patch.

Quoted 4 lines

i2c: i2c-xiic: Replace dev_err() with dev_err_probe() in probe
function
i2c: scx200_acb: Replace dev_err() with dev_err_probe() in probe
function

The rest has been already merged.

Thanks,
Andi