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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Bjorn Andersson and committed by
Jonathan Cameron
0d8f584d a9bb0610

+2 -2
+2 -2
drivers/iio/adc/qcom-spmi-adc5.c
··· 830 830 831 831 adc->nchannels = device_get_child_node_count(adc->dev); 832 832 if (!adc->nchannels) 833 - return -EINVAL; 833 + return dev_err_probe(adc->dev, -EINVAL, "no channels defined\n"); 834 834 835 835 adc->iio_chans = devm_kcalloc(adc->dev, adc->nchannels, 836 836 sizeof(*adc->iio_chans), GFP_KERNEL); ··· 903 903 904 904 ret = adc5_get_fw_data(adc); 905 905 if (ret) 906 - return dev_err_probe(dev, ret, "adc get dt data failed\n"); 906 + return ret; 907 907 908 908 irq_eoc = platform_get_irq(pdev, 0); 909 909 if (irq_eoc < 0) {