Commit f07f04a5 authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Thierry Reding

drm/tegra: Use dev_err_probe()

Replace dev_printk() with a generic dev_err_probe() helper which silences
noisy error messages about deferred probe and makes easy to debug failing
deferred probe by printing notification about the failure to KMSG in the
end of kernel booting process and by adding failing device and the reason
of deferred probe to devices_deferred of debugfs. This was proven to be
useful in the case of eDP driver regression by immediately showing why
display driver was failing when user asked for help, otherwise it would've
been much more difficult to debug such problems on a third party device
that doesn't have developer setup.
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 8913e1ae
...@@ -3211,16 +3211,9 @@ static int tegra_dc_probe(struct platform_device *pdev) ...@@ -3211,16 +3211,9 @@ static int tegra_dc_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
err = tegra_dc_rgb_probe(dc); err = tegra_dc_rgb_probe(dc);
if (err < 0 && err != -ENODEV) { if (err < 0 && err != -ENODEV)
const char *level = KERN_ERR; return dev_err_probe(&pdev->dev, err,
"failed to probe RGB output\n");
if (err == -EPROBE_DEFER)
level = KERN_DEBUG;
dev_printk(level, dc->dev, "failed to probe RGB output: %d\n",
err);
return err;
}
platform_set_drvdata(pdev, dc); platform_set_drvdata(pdev, dc);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
......
...@@ -1775,7 +1775,6 @@ static irqreturn_t tegra_hdmi_irq(int irq, void *data) ...@@ -1775,7 +1775,6 @@ static irqreturn_t tegra_hdmi_irq(int irq, void *data)
static int tegra_hdmi_probe(struct platform_device *pdev) static int tegra_hdmi_probe(struct platform_device *pdev)
{ {
const char *level = KERN_ERR;
struct tegra_hdmi *hdmi; struct tegra_hdmi *hdmi;
struct resource *regs; struct resource *regs;
int err; int err;
...@@ -1817,36 +1816,21 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1817,36 +1816,21 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
hdmi->hdmi = devm_regulator_get(&pdev->dev, "hdmi"); hdmi->hdmi = devm_regulator_get(&pdev->dev, "hdmi");
err = PTR_ERR_OR_ZERO(hdmi->hdmi); err = PTR_ERR_OR_ZERO(hdmi->hdmi);
if (err) { if (err)
if (err == -EPROBE_DEFER) return dev_err_probe(&pdev->dev, err,
level = KERN_DEBUG; "failed to get HDMI regulator\n");
dev_printk(level, &pdev->dev,
"failed to get HDMI regulator: %d\n", err);
return err;
}
hdmi->pll = devm_regulator_get(&pdev->dev, "pll"); hdmi->pll = devm_regulator_get(&pdev->dev, "pll");
err = PTR_ERR_OR_ZERO(hdmi->pll); err = PTR_ERR_OR_ZERO(hdmi->pll);
if (err) { if (err)
if (err == -EPROBE_DEFER) return dev_err_probe(&pdev->dev, err,
level = KERN_DEBUG; "failed to get PLL regulator\n");
dev_printk(level, &pdev->dev,
"failed to get PLL regulator: %d\n", err);
return err;
}
hdmi->vdd = devm_regulator_get(&pdev->dev, "vdd"); hdmi->vdd = devm_regulator_get(&pdev->dev, "vdd");
err = PTR_ERR_OR_ZERO(hdmi->vdd); err = PTR_ERR_OR_ZERO(hdmi->vdd);
if (err) { if (err)
if (err == -EPROBE_DEFER) return dev_err_probe(&pdev->dev, err,
level = KERN_DEBUG; "failed to get VDD regulator\n");
dev_printk(level, &pdev->dev,
"failed to get VDD regulator: %d\n", err);
return err;
}
hdmi->output.dev = &pdev->dev; hdmi->output.dev = &pdev->dev;
......
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