Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: dpaux: Provide error message in probe

When probing the dpaux device fails, output proper error messages to
help diagnose the cause of the failure.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+24 -6
+24 -6
drivers/gpu/drm/tegra/dpaux.c
··· 294 294 } 295 295 296 296 dpaux->rst = devm_reset_control_get(&pdev->dev, "dpaux"); 297 - if (IS_ERR(dpaux->rst)) 297 + if (IS_ERR(dpaux->rst)) { 298 + dev_err(&pdev->dev, "failed to get reset control: %ld\n", 299 + PTR_ERR(dpaux->rst)); 298 300 return PTR_ERR(dpaux->rst); 301 + } 299 302 300 303 dpaux->clk = devm_clk_get(&pdev->dev, NULL); 301 - if (IS_ERR(dpaux->clk)) 304 + if (IS_ERR(dpaux->clk)) { 305 + dev_err(&pdev->dev, "failed to get module clock: %ld\n", 306 + PTR_ERR(dpaux->clk)); 302 307 return PTR_ERR(dpaux->clk); 308 + } 303 309 304 310 err = clk_prepare_enable(dpaux->clk); 305 - if (err < 0) 311 + if (err < 0) { 312 + dev_err(&pdev->dev, "failed to enable module clock: %d\n", 313 + err); 306 314 return err; 315 + } 307 316 308 317 reset_control_deassert(dpaux->rst); 309 318 310 319 dpaux->clk_parent = devm_clk_get(&pdev->dev, "parent"); 311 - if (IS_ERR(dpaux->clk_parent)) 320 + if (IS_ERR(dpaux->clk_parent)) { 321 + dev_err(&pdev->dev, "failed to get parent clock: %ld\n", 322 + PTR_ERR(dpaux->clk_parent)); 312 323 return PTR_ERR(dpaux->clk_parent); 324 + } 313 325 314 326 err = clk_prepare_enable(dpaux->clk_parent); 315 - if (err < 0) 327 + if (err < 0) { 328 + dev_err(&pdev->dev, "failed to enable parent clock: %d\n", 329 + err); 316 330 return err; 331 + } 317 332 318 333 err = clk_set_rate(dpaux->clk_parent, 270000000); 319 334 if (err < 0) { ··· 338 323 } 339 324 340 325 dpaux->vdd = devm_regulator_get(&pdev->dev, "vdd"); 341 - if (IS_ERR(dpaux->vdd)) 326 + if (IS_ERR(dpaux->vdd)) { 327 + dev_err(&pdev->dev, "failed to get VDD supply: %ld\n", 328 + PTR_ERR(dpaux->vdd)); 342 329 return PTR_ERR(dpaux->vdd); 330 + } 343 331 344 332 err = devm_request_irq(dpaux->dev, dpaux->irq, tegra_dpaux_irq, 0, 345 333 dev_name(dpaux->dev), dpaux);