Commit 2a865248 authored by Ahmad Fatoum's avatar Ahmad Fatoum Committed by Neil Armstrong

drm: bridge: adv7511: use dev_err_probe in probe function

adv7511 probe may need to be attempted multiple times before no
-EPROBE_DEFER is returned. Currently, every such probe results in
an error message:

[    4.534229] adv7511 1-003d: failed to find dsi host
[    4.580288] adv7511 1-003d: failed to find dsi host

This is misleading, as there is no error and probe deferral is normal
behavior. Fix this by using dev_err_probe that will suppress
-EPROBE_DEFER errors. While at it, we touch all dev_err in the probe
path. This makes the code more concise and included the error code
everywhere to aid user in debugging.
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026125246.3188260-1-a.fatoum@pengutronix.de
parent fc041428
...@@ -1219,10 +1219,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id) ...@@ -1219,10 +1219,8 @@ static int adv7511_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
return ret; return ret;
ret = adv7511_init_regulators(adv7511); ret = adv7511_init_regulators(adv7511);
if (ret) { if (ret)
dev_err(dev, "failed to init regulators\n"); return dev_err_probe(dev, ret, "failed to init regulators\n");
return ret;
}
/* /*
* The power down GPIO is optional. If present, toggle it from active to * The power down GPIO is optional. If present, toggle it from active to
......
...@@ -149,16 +149,14 @@ int adv7533_attach_dsi(struct adv7511 *adv) ...@@ -149,16 +149,14 @@ int adv7533_attach_dsi(struct adv7511 *adv)
}; };
host = of_find_mipi_dsi_host_by_node(adv->host_node); host = of_find_mipi_dsi_host_by_node(adv->host_node);
if (!host) { if (!host)
dev_err(dev, "failed to find dsi host\n"); return dev_err_probe(dev, -EPROBE_DEFER,
return -EPROBE_DEFER; "failed to find dsi host\n");
}
dsi = devm_mipi_dsi_device_register_full(dev, host, &info); dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
if (IS_ERR(dsi)) { if (IS_ERR(dsi))
dev_err(dev, "failed to create dsi device\n"); return dev_err_probe(dev, PTR_ERR(dsi),
return PTR_ERR(dsi); "failed to create dsi device\n");
}
adv->dsi = dsi; adv->dsi = dsi;
...@@ -168,10 +166,8 @@ int adv7533_attach_dsi(struct adv7511 *adv) ...@@ -168,10 +166,8 @@ int adv7533_attach_dsi(struct adv7511 *adv)
MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_VIDEO_HSE; MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_VIDEO_HSE;
ret = devm_mipi_dsi_attach(dev, dsi); ret = devm_mipi_dsi_attach(dev, dsi);
if (ret < 0) { if (ret < 0)
dev_err(dev, "failed to attach dsi to host\n"); return dev_err_probe(dev, ret, "failed to attach dsi to host\n");
return ret;
}
return 0; return 0;
} }
......
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