Commit d9b329a9 authored by Trevor Gamblin's avatar Trevor Gamblin Committed by Jonathan Cameron
Browse files

iio: dac: adi-axi-dac: improve probe() error messaging



The current error handling for calls such as devm_clk_get_enabled() in
the adi-axi-dac probe() function means that, if a property such as
'clocks' (for example) is not present in the devicetree when booting a
kernel with the driver enabled, the resulting error message will be
vague, e.g.:

|adi_axi_dac 44a00000.dac: probe with driver adi_axi_dac failed with error -2

Change the devm_clk_get_enabled(), devm_regmap_init_mmio(), and
devm_iio_backend_register() checks to use dev_err_probe() with some
context for easier debugging.

After the change:

|adi_axi_dac 44a00000.dac: error -ENOENT: failed to get clock
|adi_axi_dac 44a00000.dac: probe with driver adi_axi_dac failed with error -2

Suggested-by: default avatarNuno Sa <nuno.sa@analog.com>
Tested-by: default avatarAngelo Dureghello <adureghello@baylibre.com>
Signed-off-by: default avatarTrevor Gamblin <tgamblin@baylibre.com>
Link: https://patch.msgid.link/20240617151820.3337034-1-tgamblin@baylibre.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 04eb9499
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment