mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
i2c: davinci: Simplify with dev_err_probe()
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 <krzk@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
2d1a83a4f3
commit
cc883cdf68
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user