diff options
author | Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> | 2024-10-04 16:11:01 -0700 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-10-05 12:19:01 +0100 |
commit | 0d8f584dfa983bff8bcf8bd8b9646a626716bea1 (patch) | |
tree | 5a324944a5b05c7d4372664d4cfc5055b9f97546 /drivers/iio/adc | |
parent | a9bb0610b2fade407d081169325b6a91312849b7 (diff) |
iio: adc: qcom-spmi-adc5: Tidy up adc5_get_fw_data() error messages
In the event that no channels (child nodes) are defined, the adc5 driver
will provide a generic error message indicating that adc5_get_fw_data()
returned -EINVAL. In all other error cases we get two error messages,
one helpful and the generic one.
Add a specific error message for the no channels case, and drop the
generic one, in order to improve the generates log prints in both cases.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://patch.msgid.link/20241004-spmi-adc5-no-channel-error-v1-1-1a43d13ae967@oss.qualcomm.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/qcom-spmi-adc5.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c index 9b69f40beed8..af3c2f659f5e 100644 --- a/drivers/iio/adc/qcom-spmi-adc5.c +++ b/drivers/iio/adc/qcom-spmi-adc5.c @@ -830,7 +830,7 @@ static int adc5_get_fw_data(struct adc5_chip *adc) adc->nchannels = device_get_child_node_count(adc->dev); if (!adc->nchannels) - return -EINVAL; + return dev_err_probe(adc->dev, -EINVAL, "no channels defined\n"); adc->iio_chans = devm_kcalloc(adc->dev, adc->nchannels, sizeof(*adc->iio_chans), GFP_KERNEL); @@ -903,7 +903,7 @@ static int adc5_probe(struct platform_device *pdev) ret = adc5_get_fw_data(adc); if (ret) - return dev_err_probe(dev, ret, "adc get dt data failed\n"); + return ret; irq_eoc = platform_get_irq(pdev, 0); if (irq_eoc < 0) { |