Skip to content

Commit 24d9f60

Browse files
zandaeAndi Shyti
authored andcommitted
i2c: xgene-slimpro: 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/20250511203920.325704-2-e.zanda1@gmail.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent 29b0b4c commit 24d9f60

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

drivers/i2c/busses/i2c-xgene-slimpro.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,9 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
457457
cl->tx_block = true;
458458
cl->rx_callback = slimpro_i2c_rx_cb;
459459
ctx->mbox_chan = mbox_request_channel(cl, MAILBOX_I2C_INDEX);
460-
if (IS_ERR(ctx->mbox_chan)) {
461-
dev_err(&pdev->dev, "i2c mailbox channel request failed\n");
462-
return PTR_ERR(ctx->mbox_chan);
463-
}
460+
if (IS_ERR(ctx->mbox_chan))
461+
return dev_err_probe(&pdev->dev, PTR_ERR(ctx->mbox_chan),
462+
"i2c mailbox channel request failed\n");
464463
} else {
465464
struct pcc_mbox_chan *pcc_chan;
466465
const struct acpi_device_id *acpi_id;
@@ -477,17 +476,16 @@ static int xgene_slimpro_i2c_probe(struct platform_device *pdev)
477476
cl->tx_block = false;
478477
cl->rx_callback = slimpro_i2c_pcc_rx_cb;
479478
pcc_chan = pcc_mbox_request_channel(cl, ctx->mbox_idx);
480-
if (IS_ERR(pcc_chan)) {
481-
dev_err(&pdev->dev, "PCC mailbox channel request failed\n");
482-
return PTR_ERR(pcc_chan);
483-
}
479+
if (IS_ERR(pcc_chan))
480+
return dev_err_probe(&pdev->dev, PTR_ERR(pcc_chan),
481+
"PCC mailbox channel request failed\n");
484482

485483
ctx->pcc_chan = pcc_chan;
486484
ctx->mbox_chan = pcc_chan->mchan;
487485

488486
if (!ctx->mbox_chan->mbox->txdone_irq) {
489-
dev_err(&pdev->dev, "PCC IRQ not supported\n");
490-
rc = -ENOENT;
487+
rc = dev_err_probe(&pdev->dev, -ENOENT,
488+
"PCC IRQ not supported\n");
491489
goto mbox_err;
492490
}
493491

0 commit comments

Comments
 (0)