Skip to content

Commit

Permalink
i2c: davinci: Simplify with dev_err_probe()
Browse files Browse the repository at this point in the history
Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
krzk authored and wsakernel committed Jun 23, 2021
1 parent 2d1a83a commit cc883cd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/i2c/busses/i2c-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
if (irq <= 0) {
if (!irq)
irq = -ENXIO;
if (irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"can't get irq resource ret=%d\n", irq);
return irq;
return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
}

dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
Expand Down

0 comments on commit cc883cd

Please sign in to comment.