* [PATCH v3 0/9] Use dev_err_probe in i2c probe function
@ 2023-08-08 1:29 Liao Chang
2023-08-08 1:29 ` [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in " Liao Chang
` (9 more replies)
0 siblings, 10 replies; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
NOTICE: dev_err_probe always print the second parameter that happens to
be the return value, hence the return errno will be removed from the
third parameter to avoid a redundant error message.
v3:
Convert all dev_err() in synquacer_i2c_probe() to dev_err_probe()
even if the return value is known to never be -EPROBE_DEFER.
v2:
1. Convert all dev_err() in lpi2c_imx_probe(), synquacer_i2c_probe(),
mlxbf_i2c_probe() to dev_err_probe().
2. Add Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
3. Add Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
4. Add Reviewed-by: Andi Shyti <andi.shyti@kernel.com>
Liao Chang (9):
i2c: bcm2835: Use dev_err_probe in probe function
i2c: mlxbf: Use dev_err_probe in probe function
i2c: xlp9xx: Use dev_err_probe in probe function
i2c: hisi: Use dev_err_probe in probe function
i2c: qcom-cci: Use dev_err_probe in probe function
i2c: pxa: Use dev_err_probe in probe function
i2c: dln2: Use dev_err_probe in probe function
i2c: imx-lpi2c: Use dev_err_probe in probe function
i2c: synquacer: Use dev_err_probe in probe function
drivers/i2c/busses/i2c-bcm2835.c | 14 ++++-----
drivers/i2c/busses/i2c-dln2.c | 6 ++--
drivers/i2c/busses/i2c-hisi.c | 12 +++----
drivers/i2c/busses/i2c-imx-lpi2c.c | 12 +++----
drivers/i2c/busses/i2c-mlxbf.c | 50 ++++++++++--------------------
drivers/i2c/busses/i2c-pxa.c | 7 ++---
drivers/i2c/busses/i2c-qcom-cci.c | 6 ++--
drivers/i2c/busses/i2c-synquacer.c | 28 ++++++-----------
drivers/i2c/busses/i2c-xlp9xx.c | 6 ++--
9 files changed, 50 insertions(+), 91 deletions(-)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 9:37 ` Markus Elfring
2023-08-08 1:29 ` [PATCH v3 2/9] i2c: mlxbf: " Liao Chang
` (8 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-bcm2835.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c
index 8ce6d3f49551..9af1a68269ab 100644
--- a/drivers/i2c/busses/i2c-bcm2835.c
+++ b/drivers/i2c/busses/i2c-bcm2835.c
@@ -430,10 +430,9 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
i2c_dev->bus_clk = bcm2835_i2c_register_div(&pdev->dev, mclk, i2c_dev);
- if (IS_ERR(i2c_dev->bus_clk)) {
- dev_err(&pdev->dev, "Could not register clock\n");
- return PTR_ERR(i2c_dev->bus_clk);
- }
+ if (IS_ERR(i2c_dev->bus_clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(i2c_dev->bus_clk),
+ "Could not register clock\n");
ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
&bus_clk_rate);
@@ -444,10 +443,9 @@ static int bcm2835_i2c_probe(struct platform_device *pdev)
}
ret = clk_set_rate_exclusive(i2c_dev->bus_clk, bus_clk_rate);
- if (ret < 0) {
- dev_err(&pdev->dev, "Could not set clock frequency\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret,
+ "Could not set clock frequency\n");
ret = clk_prepare_enable(i2c_dev->bus_clk);
if (ret) {
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
2023-08-08 1:29 ` [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 10:32 ` Markus Elfring
2023-08-08 1:29 ` [PATCH v3 3/9] i2c: xlp9xx: " Liao Chang
` (7 subsequent siblings)
9 siblings, 2 replies; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-mlxbf.c | 50 ++++++++++++----------------------
1 file changed, 17 insertions(+), 33 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index ae66bdd1b737..5ee82016c805 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2323,10 +2323,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
ret = mlxbf_i2c_init_resource(pdev, &priv->smbus,
MLXBF_I2C_SMBUS_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch smbus resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch smbus resource info");
priv->timer->io = priv->smbus->io;
priv->mst->io = priv->smbus->io + MLXBF_I2C_MST_ADDR_OFFSET;
@@ -2334,39 +2332,29 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
} else {
ret = mlxbf_i2c_init_resource(pdev, &priv->timer,
MLXBF_I2C_SMBUS_TIMER_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch timer resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch timer resource info");
ret = mlxbf_i2c_init_resource(pdev, &priv->mst,
MLXBF_I2C_SMBUS_MST_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch master resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch master resource info");
ret = mlxbf_i2c_init_resource(pdev, &priv->slv,
MLXBF_I2C_SMBUS_SLV_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch slave resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch slave resource info");
}
ret = mlxbf_i2c_init_resource(pdev, &priv->mst_cause,
MLXBF_I2C_MST_CAUSE_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch cause master resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch cause master resource info");
ret = mlxbf_i2c_init_resource(pdev, &priv->slv_cause,
MLXBF_I2C_SLV_CAUSE_RES);
- if (ret < 0) {
- dev_err(dev, "Cannot fetch cause slave resource info");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot fetch cause slave resource info");
adap = &priv->adap;
adap->owner = THIS_MODULE;
@@ -2397,11 +2385,9 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
* does not really hurt, then keep the code as is.
*/
ret = mlxbf_i2c_init_master(pdev, priv);
- if (ret < 0) {
- dev_err(dev, "failed to initialize smbus master %d",
- priv->bus);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to initialize smbus master %d",
+ priv->bus);
mlxbf_i2c_init_timings(pdev, priv);
@@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
IRQF_SHARED | IRQF_PROBE_SHARED,
dev_name(dev), priv);
- if (ret < 0) {
- dev_err(dev, "Cannot get irq %d\n", irq);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
priv->irq = irq;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 3/9] i2c: xlp9xx: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
2023-08-08 1:29 ` [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in " Liao Chang
2023-08-08 1:29 ` [PATCH v3 2/9] i2c: mlxbf: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 4/9] i2c: hisi: " Liao Chang
` (6 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-xlp9xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index f59e8c544f36..08a59a920929 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -529,10 +529,8 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev)
err = devm_request_irq(&pdev->dev, priv->irq, xlp9xx_i2c_isr, 0,
pdev->name, priv);
- if (err) {
- dev_err(&pdev->dev, "IRQ request failed!\n");
- return err;
- }
+ if (err)
+ return dev_err_probe(&pdev->dev, err, "IRQ request failed!\n");
init_completion(&priv->msg_complete);
priv->adapter.dev.parent = &pdev->dev;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 4/9] i2c: hisi: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (2 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 3/9] i2c: xlp9xx: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 5/9] i2c: qcom-cci: " Liao Chang
` (5 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-hisi.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c
index e067671b3ce2..6fc8d6fa43b6 100644
--- a/drivers/i2c/busses/i2c-hisi.c
+++ b/drivers/i2c/busses/i2c-hisi.c
@@ -462,18 +462,14 @@ static int hisi_i2c_probe(struct platform_device *pdev)
hisi_i2c_disable_int(ctlr, HISI_I2C_INT_ALL);
ret = devm_request_irq(dev, ctlr->irq, hisi_i2c_irq, 0, "hisi-i2c", ctlr);
- if (ret) {
- dev_err(dev, "failed to request irq handler, ret = %d\n", ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to request irq handler\n");
ctlr->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
if (IS_ERR_OR_NULL(ctlr->clk)) {
ret = device_property_read_u64(dev, "clk_rate", &clk_rate_hz);
- if (ret) {
- dev_err(dev, "failed to get clock frequency, ret = %d\n", ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get clock frequency\n");
} else {
clk_rate_hz = clk_get_rate(ctlr->clk);
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 5/9] i2c: qcom-cci: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (3 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 4/9] i2c: hisi: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-10 15:06 ` Bjorn Andersson
2023-08-08 1:29 ` [PATCH v3 6/9] i2c: pxa: " Liao Chang
` (4 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-qcom-cci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 622dc14add9d..cf13abec05f1 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -588,10 +588,8 @@ static int cci_probe(struct platform_device *pdev)
/* Clocks */
ret = devm_clk_bulk_get_all(dev, &cci->clocks);
- if (ret < 1) {
- dev_err(dev, "failed to get clocks %d\n", ret);
- return ret;
- }
+ if (ret < 1)
+ return dev_err_probe(dev, ret, "failed to get clocks\n");
cci->nclocks = ret;
/* Retrieve CCI clock rate */
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 6/9] i2c: pxa: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (4 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 5/9] i2c: qcom-cci: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 1:29 ` [PATCH v3 7/9] i2c: dln2: " Liao Chang
` (3 subsequent siblings)
9 siblings, 0 replies; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-pxa.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 937f7eebe906..79df4da0166e 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1404,10 +1404,9 @@ static int i2c_pxa_probe(struct platform_device *dev)
strscpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
i2c->clk = devm_clk_get(&dev->dev, NULL);
- if (IS_ERR(i2c->clk)) {
- dev_err(&dev->dev, "failed to get the clk: %ld\n", PTR_ERR(i2c->clk));
- return PTR_ERR(i2c->clk);
- }
+ if (IS_ERR(i2c->clk))
+ return dev_err_probe(&dev->dev, PTR_ERR(i2c->clk),
+ "failed to get the clk\n");
i2c->reg_ibmr = i2c->reg_base + pxa_reg_layout[i2c_type].ibmr;
i2c->reg_idbr = i2c->reg_base + pxa_reg_layout[i2c_type].idbr;
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 7/9] i2c: dln2: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (5 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 6/9] i2c: pxa: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 1:29 ` [PATCH v3 8/9] i2c: imx-lpi2c: " Liao Chang
` (2 subsequent siblings)
9 siblings, 0 replies; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-dln2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
index 4f02cc2fb567..631109c7a098 100644
--- a/drivers/i2c/busses/i2c-dln2.c
+++ b/drivers/i2c/busses/i2c-dln2.c
@@ -218,10 +218,8 @@ static int dln2_i2c_probe(struct platform_device *pdev)
/* initialize the i2c interface */
ret = dln2_i2c_enable(dln2, true);
- if (ret < 0) {
- dev_err(dev, "failed to initialize adapter: %d\n", ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to initialize adapter\n");
/* and finally attach to i2c layer */
ret = i2c_add_adapter(&dln2->adapter);
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 8/9] i2c: imx-lpi2c: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (6 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 7/9] i2c: dln2: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 8:37 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 9/9] i2c: synquacer: " Liao Chang
2023-08-10 8:19 ` [PATCH v3 0/9] Use dev_err_probe in i2c " Andi Shyti
9 siblings, 1 reply; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index c3287c887c6f..bfa788b3775b 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -569,10 +569,8 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
sizeof(lpi2c_imx->adapter.name));
ret = devm_clk_bulk_get_all(&pdev->dev, &lpi2c_imx->clks);
- if (ret < 0) {
- dev_err(&pdev->dev, "can't get I2C peripheral clock, ret=%d\n", ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "can't get I2C peripheral clock\n");
lpi2c_imx->num_clks = ret;
ret = of_property_read_u32(pdev->dev.of_node,
@@ -582,10 +580,8 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, irq, lpi2c_imx_isr, 0,
pdev->name, lpi2c_imx);
- if (ret) {
- dev_err(&pdev->dev, "can't claim irq %d\n", irq);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "can't claim irq %d\n", irq);
i2c_set_adapdata(&lpi2c_imx->adapter, lpi2c_imx);
platform_set_drvdata(pdev, lpi2c_imx);
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v3 9/9] i2c: synquacer: Use dev_err_probe in probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (7 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 8/9] i2c: imx-lpi2c: " Liao Chang
@ 2023-08-08 1:29 ` Liao Chang
2023-08-08 8:37 ` Krzysztof Kozlowski
2023-08-09 19:21 ` Andi Shyti
2023-08-10 8:19 ` [PATCH v3 0/9] Use dev_err_probe in i2c " Andi Shyti
9 siblings, 2 replies; 29+ messages in thread
From: Liao Chang @ 2023-08-08 1:29 UTC (permalink / raw)
To: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
Use the dev_err_probe function instead of dev_err in the probe function
so that the printed messge includes the return value and also handles
-EPROBE_DEFER nicely.
Signed-off-by: Liao Chang <liaochang1@huawei.com>
---
drivers/i2c/busses/i2c-synquacer.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
index 4cc196ca8f6d..bbea521b05dd 100644
--- a/drivers/i2c/busses/i2c-synquacer.c
+++ b/drivers/i2c/busses/i2c-synquacer.c
@@ -557,20 +557,16 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "clock source %p\n", i2c->pclk);
ret = clk_prepare_enable(i2c->pclk);
- if (ret) {
- dev_err(&pdev->dev, "failed to enable clock (%d)\n",
- ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "failed to enable clock\n");
i2c->pclkrate = clk_get_rate(i2c->pclk);
}
if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
- i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE) {
- dev_err(&pdev->dev, "PCLK missing or out of range (%d)\n",
- i2c->pclkrate);
- return -EINVAL;
- }
+ i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)
+ return dev_err_probe(&pdev->dev, -EINVAL,
+ "PCLK missing or out of range (%d)\n",
+ i2c->pclkrate);
i2c->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(i2c->base))
@@ -582,10 +578,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, i2c->irq, synquacer_i2c_isr,
0, dev_name(&pdev->dev), i2c);
- if (ret < 0) {
- dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "cannot claim IRQ %d\n", i2c->irq);
i2c->state = STATE_IDLE;
i2c->dev = &pdev->dev;
@@ -605,10 +599,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
synquacer_i2c_hw_init(i2c);
ret = i2c_add_numbered_adapter(&i2c->adapter);
- if (ret) {
- dev_err(&pdev->dev, "failed to add bus to i2c core\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "failed to add bus to i2c core\n");
platform_set_drvdata(pdev, i2c);
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v3 4/9] i2c: hisi: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 4/9] i2c: hisi: " Liao Chang
@ 2023-08-08 8:36 ` Krzysztof Kozlowski
0 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 8:36 UTC (permalink / raw)
To: Liao Chang, andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
On 08/08/2023 03:29, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> ---
> drivers/i2c/busses/i2c-hisi.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-hisi.c b/drivers/i2c/busses/i2c-hisi.c
> index e067671b3ce2..6fc8d6fa43b6 100644
> --- a/drivers/i2c/busses/i2c-hisi.c
> +++ b/drivers/i2c/busses/i2c-hisi.c
> @@ -462,18 +462,14 @@ static int hisi_i2c_probe(struct platform_device *pdev)
> hisi_i2c_disable_int(ctlr, HISI_I2C_INT_ALL);
>
> ret = devm_request_irq(dev, ctlr->irq, hisi_i2c_irq, 0, "hisi-i2c", ctlr);
> - if (ret) {
> - dev_err(dev, "failed to request irq handler, ret = %d\n", ret);
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to request irq handler\n");
I don't think this is needed:
https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 3/9] i2c: xlp9xx: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 3/9] i2c: xlp9xx: " Liao Chang
@ 2023-08-08 8:36 ` Krzysztof Kozlowski
0 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 8:36 UTC (permalink / raw)
To: Liao Chang, andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
On 08/08/2023 03:29, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> ---
> drivers/i2c/busses/i2c-xlp9xx.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
> index f59e8c544f36..08a59a920929 100644
> --- a/drivers/i2c/busses/i2c-xlp9xx.c
> +++ b/drivers/i2c/busses/i2c-xlp9xx.c
> @@ -529,10 +529,8 @@ static int xlp9xx_i2c_probe(struct platform_device *pdev)
>
> err = devm_request_irq(&pdev->dev, priv->irq, xlp9xx_i2c_isr, 0,
> pdev->name, priv);
> - if (err) {
> - dev_err(&pdev->dev, "IRQ request failed!\n");
I don't think this is needed:
https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 2/9] i2c: mlxbf: " Liao Chang
@ 2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 11:29 ` Andi Shyti
2023-08-08 10:32 ` Markus Elfring
1 sibling, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 8:36 UTC (permalink / raw)
To: Liao Chang, andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
On 08/08/2023 03:29, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
...
> @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
> ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
> IRQF_SHARED | IRQF_PROBE_SHARED,
> dev_name(dev), priv);
> - if (ret < 0) {
> - dev_err(dev, "Cannot get irq %d\n", irq);
> - return ret;
> - }
> + if (ret < 0)
> + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
I don't think this is needed:
https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 8/9] i2c: imx-lpi2c: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 8/9] i2c: imx-lpi2c: " Liao Chang
@ 2023-08-08 8:37 ` Krzysztof Kozlowski
0 siblings, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 8:37 UTC (permalink / raw)
To: Liao Chang, andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
On 08/08/2023 03:29, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> ret = devm_request_irq(&pdev->dev, irq, lpi2c_imx_isr, 0,
> pdev->name, lpi2c_imx);
> - if (ret) {
> - dev_err(&pdev->dev, "can't claim irq %d\n", irq);
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret, "can't claim irq %d\n", irq);
>
I don't think this is needed:
https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 9/9] i2c: synquacer: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 9/9] i2c: synquacer: " Liao Chang
@ 2023-08-08 8:37 ` Krzysztof Kozlowski
2023-08-09 19:21 ` Andi Shyti
1 sibling, 0 replies; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 8:37 UTC (permalink / raw)
To: Liao Chang, andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian
Cc: linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm
On 08/08/2023 03:29, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> i2c->base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(i2c->base))
> @@ -582,10 +578,8 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
>
> ret = devm_request_irq(&pdev->dev, i2c->irq, synquacer_i2c_isr,
> 0, dev_name(&pdev->dev), i2c);
> - if (ret < 0) {
> - dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
> - return ret;
> - }
> + if (ret < 0)
> + return dev_err_probe(&pdev->dev, ret, "cannot claim IRQ %d\n", i2c->irq);
>
I don't think this is needed:
https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in " Liao Chang
@ 2023-08-08 9:37 ` Markus Elfring
2023-08-08 11:31 ` Andi Shyti
0 siblings, 1 reply; 29+ messages in thread
From: Markus Elfring @ 2023-08-08 9:37 UTC (permalink / raw)
To: Liao Chang, linux-i2c, kernel-janitors, linux-arm-msm,
linux-arm-kernel, linux-rpi-kernel, bcm-kernel-feedback-list,
kernel, linux-imx, Andi Shyti, Ard Biesheuvel, Asmaa Mnebhi,
Dong Aisheng, Fabio Estevam, Florian Fainelli, George Cherian,
Khalil Blaiech, Loic Poulain, Ray Jui, Robert Foss, Sascha Hauer,
Scott Branden, Shawn Guo, Yicong Yang
Cc: LKML
…
> so that the printed messge includes …
Please avoid a typo in such a wording.
How do you think about to avoid empty descriptions according to addresses
in applied recipient lists?
Regards,
Markus
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 2/9] i2c: mlxbf: " Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
@ 2023-08-08 10:32 ` Markus Elfring
1 sibling, 0 replies; 29+ messages in thread
From: Markus Elfring @ 2023-08-08 10:32 UTC (permalink / raw)
To: Liao Chang, linux-i2c, kernel-janitors, linux-arm-msm,
linux-arm-kernel, linux-rpi-kernel, bcm-kernel-feedback-list,
kernel, linux-imx, Andi Shyti, Ard Biesheuvel, Asmaa Mnebhi,
Dong Aisheng, Fabio Estevam, Florian Fainelli, George Cherian,
Khalil Blaiech, Loic Poulain, Ray Jui, Robert Foss, Sascha Hauer,
Scott Branden, Shawn Guo, Yicong Yang
Cc: LKML
…
> so that the printed messge includes …
How do you think about to avoid another typo in similar wordings?
Regards,
Markus
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 8:36 ` Krzysztof Kozlowski
@ 2023-08-08 11:29 ` Andi Shyti
2023-08-08 11:31 ` Krzysztof Kozlowski
0 siblings, 1 reply; 29+ messages in thread
From: Andi Shyti @ 2023-08-08 11:29 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Liao Chang, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
Hi Krzysztof,
On Tue, Aug 08, 2023 at 10:36:40AM +0200, Krzysztof Kozlowski wrote:
> On 08/08/2023 03:29, Liao Chang wrote:
> > Use the dev_err_probe function instead of dev_err in the probe function
> > so that the printed messge includes the return value and also handles
> > -EPROBE_DEFER nicely.
> >
> > Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> > Signed-off-by: Liao Chang <liaochang1@huawei.com>
>
> ...
>
> > @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
> > ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
> > IRQF_SHARED | IRQF_PROBE_SHARED,
> > dev_name(dev), priv);
> > - if (ret < 0) {
> > - dev_err(dev, "Cannot get irq %d\n", irq);
> > - return ret;
> > - }
> > + if (ret < 0)
> > + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
>
> I don't think this is needed:
> https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
Hmm, that's a bit borderline, I'd say. The change to
devm_request_irq/devm_request_threaded_irq_probe seems like
something for another series. But for now, I think I'll accept
this as it is since it fits within the scope of this current
series.
Andi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 11:29 ` Andi Shyti
@ 2023-08-08 11:31 ` Krzysztof Kozlowski
2023-08-08 11:47 ` Andi Shyti
0 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 11:31 UTC (permalink / raw)
To: Andi Shyti
Cc: Liao Chang, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
On 08/08/2023 13:29, Andi Shyti wrote:
> Hi Krzysztof,
>
> On Tue, Aug 08, 2023 at 10:36:40AM +0200, Krzysztof Kozlowski wrote:
>> On 08/08/2023 03:29, Liao Chang wrote:
>>> Use the dev_err_probe function instead of dev_err in the probe function
>>> so that the printed messge includes the return value and also handles
>>> -EPROBE_DEFER nicely.
>>>
>>> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
>>> Signed-off-by: Liao Chang <liaochang1@huawei.com>
>>
>> ...
>>
>>> @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
>>> ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
>>> IRQF_SHARED | IRQF_PROBE_SHARED,
>>> dev_name(dev), priv);
>>> - if (ret < 0) {
>>> - dev_err(dev, "Cannot get irq %d\n", irq);
>>> - return ret;
>>> - }
>>> + if (ret < 0)
>>> + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
>>
>> I don't think this is needed:
>> https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
>
> Hmm, that's a bit borderline, I'd say. The change to
What's borderline exactly? devm_request_threaded_irq_probe() is coming,
right? If it is accepted this hunk is useless and soon should be
replaced with proper one.
Instead of making many trivial changes doing the same, all these series
should be aligned.
> devm_request_irq/devm_request_threaded_irq_probe seems like
> something for another series. But for now, I think I'll accept
> this as it is since it fits within the scope of this current
> series.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in probe function
2023-08-08 9:37 ` Markus Elfring
@ 2023-08-08 11:31 ` Andi Shyti
0 siblings, 0 replies; 29+ messages in thread
From: Andi Shyti @ 2023-08-08 11:31 UTC (permalink / raw)
To: Markus Elfring
Cc: Liao Chang, linux-i2c, kernel-janitors, linux-arm-msm,
linux-arm-kernel, linux-rpi-kernel, bcm-kernel-feedback-list,
kernel, linux-imx, Ard Biesheuvel, Asmaa Mnebhi, Dong Aisheng,
Fabio Estevam, Florian Fainelli, George Cherian, Khalil Blaiech,
Loic Poulain, Ray Jui, Robert Foss, Sascha Hauer, Scott Branden,
Shawn Guo, Yicong Yang, LKML
Hi Markus,
On Tue, Aug 08, 2023 at 11:37:33AM +0200, Markus Elfring wrote:
> …
> > so that the printed messge includes …
>
> Please avoid a typo in such a wording.
yes, I noticed this... and thanks for pointing it out. If no
other version will be sent I can fix /messge/message/ while
applying this series.
Thank you,
Andi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 11:31 ` Krzysztof Kozlowski
@ 2023-08-08 11:47 ` Andi Shyti
2023-08-08 15:55 ` Krzysztof Kozlowski
0 siblings, 1 reply; 29+ messages in thread
From: Andi Shyti @ 2023-08-08 11:47 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Liao Chang, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
Hi Krzysztof,
On Tue, Aug 08, 2023 at 01:31:31PM +0200, Krzysztof Kozlowski wrote:
> On 08/08/2023 13:29, Andi Shyti wrote:
> > Hi Krzysztof,
> >
> > On Tue, Aug 08, 2023 at 10:36:40AM +0200, Krzysztof Kozlowski wrote:
> >> On 08/08/2023 03:29, Liao Chang wrote:
> >>> Use the dev_err_probe function instead of dev_err in the probe function
> >>> so that the printed messge includes the return value and also handles
> >>> -EPROBE_DEFER nicely.
> >>>
> >>> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> >>> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> >>
> >> ...
> >>
> >>> @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
> >>> ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
> >>> IRQF_SHARED | IRQF_PROBE_SHARED,
> >>> dev_name(dev), priv);
> >>> - if (ret < 0) {
> >>> - dev_err(dev, "Cannot get irq %d\n", irq);
> >>> - return ret;
> >>> - }
> >>> + if (ret < 0)
> >>> + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
> >>
> >> I don't think this is needed:
> >> https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
> >
> > Hmm, that's a bit borderline, I'd say. The change to
>
> What's borderline exactly? devm_request_threaded_irq_probe() is coming,
> right? If it is accepted this hunk is useless and soon should be
> replaced with proper one.
Such change is out of the scope of this series, there are two
options that I'd prefer (in the listed order):
1. accept the patch as it is, this patch is not sent today the
first time and at the current state it's correct.
2. not accept a change on this line
Replacing devm_request_irq belongs to another series and,
besides, I don't want to ask Liao to hold on this series for such
trivialities.
Thank you,
Andi
> Instead of making many trivial changes doing the same, all these series
> should be aligned.
>
> > devm_request_irq/devm_request_threaded_irq_probe seems like
> > something for another series. But for now, I think I'll accept
> > this as it is since it fits within the scope of this current
> > series.
>
>
> Best regards,
> Krzysztof
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 11:47 ` Andi Shyti
@ 2023-08-08 15:55 ` Krzysztof Kozlowski
2023-08-09 8:02 ` Andi Shyti
0 siblings, 1 reply; 29+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-08 15:55 UTC (permalink / raw)
To: Andi Shyti
Cc: Liao Chang, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
On 08/08/2023 13:47, Andi Shyti wrote:
> Hi Krzysztof,
>
> On Tue, Aug 08, 2023 at 01:31:31PM +0200, Krzysztof Kozlowski wrote:
>> On 08/08/2023 13:29, Andi Shyti wrote:
>>> Hi Krzysztof,
>>>
>>> On Tue, Aug 08, 2023 at 10:36:40AM +0200, Krzysztof Kozlowski wrote:
>>>> On 08/08/2023 03:29, Liao Chang wrote:
>>>>> Use the dev_err_probe function instead of dev_err in the probe function
>>>>> so that the printed messge includes the return value and also handles
>>>>> -EPROBE_DEFER nicely.
>>>>>
>>>>> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
>>>>> Signed-off-by: Liao Chang <liaochang1@huawei.com>
>>>>
>>>> ...
>>>>
>>>>> @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
>>>>> ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
>>>>> IRQF_SHARED | IRQF_PROBE_SHARED,
>>>>> dev_name(dev), priv);
>>>>> - if (ret < 0) {
>>>>> - dev_err(dev, "Cannot get irq %d\n", irq);
>>>>> - return ret;
>>>>> - }
>>>>> + if (ret < 0)
>>>>> + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
>>>>
>>>> I don't think this is needed:
>>>> https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
>>>
>>> Hmm, that's a bit borderline, I'd say. The change to
>>
>> What's borderline exactly? devm_request_threaded_irq_probe() is coming,
>> right? If it is accepted this hunk is useless and soon should be
>> replaced with proper one.
>
> Such change is out of the scope of this series, there are two
> options that I'd prefer (in the listed order):
>
> 1. accept the patch as it is, this patch is not sent today the
> first time and at the current state it's correct.
> 2. not accept a change on this line
The 2 is what I commented here. This change should not be made and
instead we should just switch all such users to new API, because this is
preferred for all error messages, when applicable and does not result in
lost context. If there was no such API, sure, but we have this API coming.
>
> Replacing devm_request_irq belongs to another series and,
> besides, I don't want to ask Liao to hold on this series for such
> trivialities.
So the comment about this redundant and unneeded change, thus switching
to new API you call 'triviality' but a comment of yours of changing the
tone of error message to 'please' is appropriate.
https://lore.kernel.org/all/20230807231320.svssge6uymw3jiho@intel.intel/
That's double standards.
Best regards,
Krzysztof
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 2/9] i2c: mlxbf: Use dev_err_probe in probe function
2023-08-08 15:55 ` Krzysztof Kozlowski
@ 2023-08-09 8:02 ` Andi Shyti
0 siblings, 0 replies; 29+ messages in thread
From: Andi Shyti @ 2023-08-09 8:02 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Liao Chang, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
On Tue, Aug 08, 2023 at 05:55:29PM +0200, Krzysztof Kozlowski wrote:
> On 08/08/2023 13:47, Andi Shyti wrote:
> > Hi Krzysztof,
> >
> > On Tue, Aug 08, 2023 at 01:31:31PM +0200, Krzysztof Kozlowski wrote:
> >> On 08/08/2023 13:29, Andi Shyti wrote:
> >>> Hi Krzysztof,
> >>>
> >>> On Tue, Aug 08, 2023 at 10:36:40AM +0200, Krzysztof Kozlowski wrote:
> >>>> On 08/08/2023 03:29, Liao Chang wrote:
> >>>>> Use the dev_err_probe function instead of dev_err in the probe function
> >>>>> so that the printed messge includes the return value and also handles
> >>>>> -EPROBE_DEFER nicely.
> >>>>>
> >>>>> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> >>>>> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> >>>>
> >>>> ...
> >>>>
> >>>>> @@ -2413,10 +2399,8 @@ static int mlxbf_i2c_probe(struct platform_device *pdev)
> >>>>> ret = devm_request_irq(dev, irq, mlxbf_i2c_irq,
> >>>>> IRQF_SHARED | IRQF_PROBE_SHARED,
> >>>>> dev_name(dev), priv);
> >>>>> - if (ret < 0) {
> >>>>> - dev_err(dev, "Cannot get irq %d\n", irq);
> >>>>> - return ret;
> >>>>> - }
> >>>>> + if (ret < 0)
> >>>>> + return dev_err_probe(dev, ret, "Cannot get irq %d\n", irq);
> >>>>
> >>>> I don't think this is needed:
> >>>> https://lore.kernel.org/all/20230721094641.77189-1-frank.li@vivo.com/
> >>>
> >>> Hmm, that's a bit borderline, I'd say. The change to
> >>
> >> What's borderline exactly? devm_request_threaded_irq_probe() is coming,
> >> right? If it is accepted this hunk is useless and soon should be
> >> replaced with proper one.
> >
> > Such change is out of the scope of this series, there are two
> > options that I'd prefer (in the listed order):
> >
> > 1. accept the patch as it is, this patch is not sent today the
> > first time and at the current state it's correct.
> > 2. not accept a change on this line
>
> The 2 is what I commented here. This change should not be made and
> instead we should just switch all such users to new API, because this is
> preferred for all error messages, when applicable and does not result in
> lost context. If there was no such API, sure, but we have this API coming.
To me the patch is correct... I am OK also with 2, but I find 1
more complete... let's say that it's a matter of taste?
> > Replacing devm_request_irq belongs to another series and,
> > besides, I don't want to ask Liao to hold on this series for such
> > trivialities.
>
> So the comment about this redundant and unneeded change, thus switching
> to new API you call 'triviality' but a comment of yours of changing the
> tone of error message to 'please' is appropriate.
> https://lore.kernel.org/all/20230807231320.svssge6uymw3jiho@intel.intel/
>
> That's double standards.
That was a joke, the review was somewhere else in my comment.
Thanks for your inputs,
Andi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 9/9] i2c: synquacer: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 9/9] i2c: synquacer: " Liao Chang
2023-08-08 8:37 ` Krzysztof Kozlowski
@ 2023-08-09 19:21 ` Andi Shyti
2023-08-10 2:33 ` Liao, Chang
1 sibling, 1 reply; 29+ messages in thread
From: Andi Shyti @ 2023-08-09 19:21 UTC (permalink / raw)
To: Liao Chang
Cc: florian.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
yangyicong, aisheng.dong, shawnguo, s.hauer, kernel, festevam,
linux-imx, kblaiech, asmaa, loic.poulain, rfoss, ardb, gcherian,
linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, Krzysztof Kozlowski
Hi Liao,
On Tue, Aug 08, 2023 at 09:29:54AM +0800, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
After some discussions and time, I think it's right to r-b this
patch. If you agree more with Krzysztof, feel free to follow his
recommendation and send another version otherwise I will go ahead
and take this series in my branch. I do not really mind, both
arguments are valid.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Thanks,
Andi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 9/9] i2c: synquacer: Use dev_err_probe in probe function
2023-08-09 19:21 ` Andi Shyti
@ 2023-08-10 2:33 ` Liao, Chang
2023-08-10 8:10 ` Andi Shyti
0 siblings, 1 reply; 29+ messages in thread
From: Liao, Chang @ 2023-08-10 2:33 UTC (permalink / raw)
To: Andi Shyti
Cc: florian.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
yangyicong, aisheng.dong, shawnguo, s.hauer, kernel, festevam,
linux-imx, kblaiech, asmaa, loic.poulain, rfoss, ardb, gcherian,
linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, Krzysztof Kozlowski
Hi Andi and Krzysztof,
在 2023/8/10 3:21, Andi Shyti 写道:
> Hi Liao,
>
> On Tue, Aug 08, 2023 at 09:29:54AM +0800, Liao Chang wrote:
>> Use the dev_err_probe function instead of dev_err in the probe function
>> so that the printed messge includes the return value and also handles
>> -EPROBE_DEFER nicely.
>>
>> Signed-off-by: Liao Chang <liaochang1@huawei.com>
>
> After some discussions and time, I think it's right to r-b this
> patch. If you agree more with Krzysztof, feel free to follow his
> recommendation and send another version otherwise I will go ahead
> and take this series in my branch. I do not really mind, both
> arguments are valid.
I saw that Frank Li developed some new APIs that look like they would be very
helpful for aligning the error messages of devm_request_irq in device probes.
However, the patches have been pending for weeks and the author hasn't sent a
new version. So I'm not planning to switch to the new APIs in this patch series,
if there are no objections.
Do I need to resend a new revision to add your R-B at this patch?
Thanks.
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
>
> Thanks,
> Andi
--
BR
Liao, Chang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 9/9] i2c: synquacer: Use dev_err_probe in probe function
2023-08-10 2:33 ` Liao, Chang
@ 2023-08-10 8:10 ` Andi Shyti
0 siblings, 0 replies; 29+ messages in thread
From: Andi Shyti @ 2023-08-10 8:10 UTC (permalink / raw)
To: Liao, Chang
Cc: florian.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
yangyicong, aisheng.dong, shawnguo, s.hauer, kernel, festevam,
linux-imx, kblaiech, asmaa, loic.poulain, rfoss, ardb, gcherian,
linux-i2c, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
linux-arm-msm, Krzysztof Kozlowski
Hi Liao,
On Thu, Aug 10, 2023 at 10:33:58AM +0800, Liao, Chang wrote:
> Hi Andi and Krzysztof,
>
> 在 2023/8/10 3:21, Andi Shyti 写道:
> > Hi Liao,
> >
> > On Tue, Aug 08, 2023 at 09:29:54AM +0800, Liao Chang wrote:
> >> Use the dev_err_probe function instead of dev_err in the probe function
> >> so that the printed messge includes the return value and also handles
> >> -EPROBE_DEFER nicely.
> >>
> >> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> >
> > After some discussions and time, I think it's right to r-b this
> > patch. If you agree more with Krzysztof, feel free to follow his
> > recommendation and send another version otherwise I will go ahead
> > and take this series in my branch. I do not really mind, both
> > arguments are valid.
>
> I saw that Frank Li developed some new APIs that look like they would be very
> helpful for aligning the error messages of devm_request_irq in device probes.
> However, the patches have been pending for weeks and the author hasn't sent a
> new version. So I'm not planning to switch to the new APIs in this patch series,
> if there are no objections.
>
> Do I need to resend a new revision to add your R-B at this patch?
no, no need. I'm also going to fix a typo in the commit message
(messge/message) that Markus has pointed out.
Thanks for this series of cleanups,
Andi
> Thanks.
>
> >
> > Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> >
> > Thanks,
> > Andi
>
> --
> BR
> Liao, Chang
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 0/9] Use dev_err_probe in i2c probe function
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
` (8 preceding siblings ...)
2023-08-08 1:29 ` [PATCH v3 9/9] i2c: synquacer: " Liao Chang
@ 2023-08-10 8:19 ` Andi Shyti
2023-08-14 15:16 ` Wolfram Sang
9 siblings, 1 reply; 29+ messages in thread
From: Andi Shyti @ 2023-08-10 8:19 UTC (permalink / raw)
To: florian.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
yangyicong, aisheng.dong, shawnguo, s.hauer, kernel, festevam,
linux-imx, kblaiech, asmaa, loic.poulain, rfoss, ardb, gcherian,
Liao Chang
Cc: Andi Shyti, linux-i2c, linux-rpi-kernel, linux-arm-kernel,
linux-kernel, linux-arm-msm
Hi
On Tue, 08 Aug 2023 09:29:45 +0800, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> NOTICE: dev_err_probe always print the second parameter that happens to
> be the return value, hence the return errno will be removed from the
> third parameter to avoid a redundant error message.
>
> [...]
With the messge/message change in the commit log, applied to
i2c/andi-for-next on
https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git
Please note that this patch may still undergo further evaluation
and the final decision will be made in collaboration with
Wolfram.
Thank you,
Andi
Patches applied
===============
[1/9] i2c: bcm2835: Use dev_err_probe in probe function
commit: 7aec2f39a1a4be99a7872e2342a69b96396c3e0c
[2/9] i2c: mlxbf: Use dev_err_probe in probe function
commit: 45a7a0524bff52360f82277f165bbdef7a199484
[3/9] i2c: xlp9xx: Use dev_err_probe in probe function
commit: 9a648b3f56c49551081b9560392e9a640aa3d5cb
[4/9] i2c: hisi: Use dev_err_probe in probe function
commit: 3c5e6ae40164ba6af1efaa1ca94e2cdea0c8f25e
[5/9] i2c: qcom-cci: Use dev_err_probe in probe function
commit: 605efbf43813857d8110ca0b5bda75f93426a789
[6/9] i2c: pxa: Use dev_err_probe in probe function
commit: d29066600a85b15077221be404a38d9c4bf5b888
[7/9] i2c: dln2: Use dev_err_probe in probe function
commit: 235712aa7ebf75a8442905ae672c02a4f9f8468c
[8/9] i2c: imx-lpi2c: Use dev_err_probe in probe function
commit: 5d51af11f41eb348d9c3ccb5c74ffa9078673166
[9/9] i2c: synquacer: Use dev_err_probe in probe function
commit: 7a34bab2daeaae6d2f32bdfa20b876a8f210cd7a
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 5/9] i2c: qcom-cci: Use dev_err_probe in probe function
2023-08-08 1:29 ` [PATCH v3 5/9] i2c: qcom-cci: " Liao Chang
@ 2023-08-10 15:06 ` Bjorn Andersson
0 siblings, 0 replies; 29+ messages in thread
From: Bjorn Andersson @ 2023-08-10 15:06 UTC (permalink / raw)
To: Liao Chang
Cc: andi.shyti, florian.fainelli, rjui, sbranden,
bcm-kernel-feedback-list, yangyicong, aisheng.dong, shawnguo,
s.hauer, kernel, festevam, linux-imx, kblaiech, asmaa,
loic.poulain, rfoss, ardb, gcherian, linux-i2c, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, linux-arm-msm
On Tue, Aug 08, 2023 at 09:29:50AM +0800, Liao Chang wrote:
> Use the dev_err_probe function instead of dev_err in the probe function
> so that the printed messge includes the return value and also handles
> -EPROBE_DEFER nicely.
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> Signed-off-by: Liao Chang <liaochang1@huawei.com>
> ---
> drivers/i2c/busses/i2c-qcom-cci.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index 622dc14add9d..cf13abec05f1 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -588,10 +588,8 @@ static int cci_probe(struct platform_device *pdev)
> /* Clocks */
>
> ret = devm_clk_bulk_get_all(dev, &cci->clocks);
> - if (ret < 1) {
> - dev_err(dev, "failed to get clocks %d\n", ret);
> - return ret;
> - }
> + if (ret < 1)
> + return dev_err_probe(dev, ret, "failed to get clocks\n");
devm_clk_bulk_get_all() will already have printed a more useful/specific
error message. Unfortunately will not be carried as the deferred probe
reason, but this error will just indicate that some clock controller
wasn't ready...
TL;DR I think we should just drop the error print from here instead.
Regards,
Bjorn
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v3 0/9] Use dev_err_probe in i2c probe function
2023-08-10 8:19 ` [PATCH v3 0/9] Use dev_err_probe in i2c " Andi Shyti
@ 2023-08-14 15:16 ` Wolfram Sang
0 siblings, 0 replies; 29+ messages in thread
From: Wolfram Sang @ 2023-08-14 15:16 UTC (permalink / raw)
To: Andi Shyti
Cc: florian.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
yangyicong, aisheng.dong, shawnguo, s.hauer, kernel, festevam,
linux-imx, kblaiech, asmaa, loic.poulain, rfoss, ardb, gcherian,
Liao Chang, linux-i2c, linux-rpi-kernel, linux-arm-kernel,
linux-kernel, linux-arm-msm
[-- Attachment #1.1: Type: text/plain, Size: 592 bytes --]
On Thu, Aug 10, 2023 at 10:19:35AM +0200, Andi Shyti wrote:
> Hi
>
> On Tue, 08 Aug 2023 09:29:45 +0800, Liao Chang wrote:
> > Use the dev_err_probe function instead of dev_err in the probe function
> > so that the printed messge includes the return value and also handles
> > -EPROBE_DEFER nicely.
> >
> > NOTICE: dev_err_probe always print the second parameter that happens to
> > be the return value, hence the return errno will be removed from the
> > third parameter to avoid a redundant error message.
> >
> > [...]
Applied to for-next (via Andi's branch), thanks!
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2023-08-14 15:17 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-08 1:29 [PATCH v3 0/9] Use dev_err_probe in i2c probe function Liao Chang
2023-08-08 1:29 ` [PATCH v3 1/9] i2c: bcm2835: Use dev_err_probe in " Liao Chang
2023-08-08 9:37 ` Markus Elfring
2023-08-08 11:31 ` Andi Shyti
2023-08-08 1:29 ` [PATCH v3 2/9] i2c: mlxbf: " Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 11:29 ` Andi Shyti
2023-08-08 11:31 ` Krzysztof Kozlowski
2023-08-08 11:47 ` Andi Shyti
2023-08-08 15:55 ` Krzysztof Kozlowski
2023-08-09 8:02 ` Andi Shyti
2023-08-08 10:32 ` Markus Elfring
2023-08-08 1:29 ` [PATCH v3 3/9] i2c: xlp9xx: " Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 4/9] i2c: hisi: " Liao Chang
2023-08-08 8:36 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 5/9] i2c: qcom-cci: " Liao Chang
2023-08-10 15:06 ` Bjorn Andersson
2023-08-08 1:29 ` [PATCH v3 6/9] i2c: pxa: " Liao Chang
2023-08-08 1:29 ` [PATCH v3 7/9] i2c: dln2: " Liao Chang
2023-08-08 1:29 ` [PATCH v3 8/9] i2c: imx-lpi2c: " Liao Chang
2023-08-08 8:37 ` Krzysztof Kozlowski
2023-08-08 1:29 ` [PATCH v3 9/9] i2c: synquacer: " Liao Chang
2023-08-08 8:37 ` Krzysztof Kozlowski
2023-08-09 19:21 ` Andi Shyti
2023-08-10 2:33 ` Liao, Chang
2023-08-10 8:10 ` Andi Shyti
2023-08-10 8:19 ` [PATCH v3 0/9] Use dev_err_probe in i2c " Andi Shyti
2023-08-14 15:16 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).