mtd: onenand: 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: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200901142535.12819-1-krzk@kernel.org
This commit is contained in:
Родитель
85a3ebbb7f
Коммит
28acb2ce42
|
@ -494,11 +494,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
|
|||
|
||||
c->int_gpiod = devm_gpiod_get_optional(dev, "int", GPIOD_IN);
|
||||
if (IS_ERR(c->int_gpiod)) {
|
||||
r = PTR_ERR(c->int_gpiod);
|
||||
/* Just try again if this happens */
|
||||
if (r != -EPROBE_DEFER)
|
||||
dev_err(dev, "error getting gpio: %d\n", r);
|
||||
return r;
|
||||
return dev_err_probe(dev, PTR_ERR(c->int_gpiod), "error getting gpio\n");
|
||||
}
|
||||
|
||||
if (c->int_gpiod) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче