Re: [PATCH 1/5] iio: Remove redundant probe error messages for HID device drivers
From: Sanjay Chitroda
Date: Mon Nov 16 2026 - 01:42:17 EST
On 5 November 2026 9:22:54 pm IST, Joshua Crofts <crofts@xxxxxxxxxx> wrote:
>On Thu, 5 Nov 2026 14:40:36 +0100
>Joshua Crofts <crofts@xxxxxxxxxx> wrote:
>
>> On Thu, 05 Nov 2026 18:11:43 +0530
>> Sanjay Chitroda via B4 Relay <devnull+sanjayembeddedse.gmail.com@xxxxxxxxxx> wrote:
>>
>> ...
>>
>> > @@ -377,20 +377,16 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
>> >
>> > ret = devm_hid_sensor_setup_trigger(dev, indio_dev, name,
>> > &accel_state->common_attributes);
>> > - if (ret < 0) {
>> > - dev_err(&pdev->dev, "trigger setup failed\n");
>> > + if (ret < 0)
>>
>> You could also remove the comparison and just change the checks to `if (ret)`,
>> as devm_hid_sensor_setup_trigger() always returns zero on success.
>
>I suppose you could also add a precursor patch that changes `return ret` to
>`return 0` in devm_hid_sensor_setup_trigger() on success.
Hi Joshua,
Thank you the review and input.
I agree with your point to replace (ret < 0) with (ret) as devm API returns zero on success.
Do we find value to add new check and have `return 0` ?
devm_add_action_or_reset() is last operation in devm_hid_sensor_setup_trigger() API which makes direct return as simple to follow.
Based on your suggestion will send v2 with additional changes as trailing in the series.
>