drm: bridge: simple-bridge: Use dev_err_probe()
Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/202303221622511915615@zte.com.cn
This commit is contained in:
committed by
Neil Armstrong
parent
ed8f4e1002
commit
db8496d0b5
@ -202,11 +202,9 @@ static int simple_bridge_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
sbridge->enable = devm_gpiod_get_optional(&pdev->dev, "enable",
|
sbridge->enable = devm_gpiod_get_optional(&pdev->dev, "enable",
|
||||||
GPIOD_OUT_LOW);
|
GPIOD_OUT_LOW);
|
||||||
if (IS_ERR(sbridge->enable)) {
|
if (IS_ERR(sbridge->enable))
|
||||||
if (PTR_ERR(sbridge->enable) != -EPROBE_DEFER)
|
return dev_err_probe(&pdev->dev, PTR_ERR(sbridge->enable),
|
||||||
dev_err(&pdev->dev, "Unable to retrieve enable GPIO\n");
|
"Unable to retrieve enable GPIO\n");
|
||||||
return PTR_ERR(sbridge->enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Register the bridge. */
|
/* Register the bridge. */
|
||||||
sbridge->bridge.funcs = &simple_bridge_bridge_funcs;
|
sbridge->bridge.funcs = &simple_bridge_bridge_funcs;
|
||||||
|
Reference in New Issue
Block a user