Commit d60b9391 authored by Cai Huoqing's avatar Cai Huoqing Committed by Sam Ravnborg

drm/panel: sofef00: Make use of the helper function dev_err_probe()

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210916104635.11675-1-caihuoqing@baidu.com
parent 94f9b952
...@@ -270,18 +270,14 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi) ...@@ -270,18 +270,14 @@ static int sofef00_panel_probe(struct mipi_dsi_device *dsi)
} }
ctx->supply = devm_regulator_get(dev, "vddio"); ctx->supply = devm_regulator_get(dev, "vddio");
if (IS_ERR(ctx->supply)) { if (IS_ERR(ctx->supply))
ret = PTR_ERR(ctx->supply); return dev_err_probe(dev, PTR_ERR(ctx->supply),
dev_err(dev, "Failed to get vddio regulator: %d\n", ret); "Failed to get vddio regulator\n");
return ret;
}
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio)) { if (IS_ERR(ctx->reset_gpio))
ret = PTR_ERR(ctx->reset_gpio); return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
dev_warn(dev, "Failed to get reset-gpios: %d\n", ret); "Failed to get reset-gpios\n");
return ret;
}
ctx->dsi = dsi; ctx->dsi = dsi;
mipi_dsi_set_drvdata(dsi, ctx); mipi_dsi_set_drvdata(dsi, ctx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment