Re: [PATCH v2 3/7] iio: magnetometer: hid-sensor-magn-3d: drop redundant probe error messages

From: Sanjay Chitroda

Date: Mon Nov 30 2026 - 12:04:53 EST




On 27 November 2026 4:39:01 pm IST, Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
>On Fri, Nov 27, 2026 at 04:03:58PM +0530, Sanjay Chitroda via B4 Relay wrote:
>>
>> The probe path emits error messages for conditions where the failure is
>> either already conveyed by the returned error code or can be identified
>> from the existing debug messages in the magn_3d_parse_report().
>>
>> Remove the redundant error messages to reduce log noise and simplify the
>> error handling code.
>
>...
>
>> - if (attr_count <= 0) {
>> - dev_err(&pdev->dev,
>> - "failed to find any supported usage attributes in report\n");
>> + if (attr_count <= 0)
>> return -EINVAL;
>> - }
>
>What is the meaning of attr_count < 0 value? Does it hold the error code already?
>

attr_count is not the error code. it's incremented for each supported magnetic channel usage found in the HID report.

>...
>
>> static int magn_3d_parse_report(struct platform_device *pdev,
>
>> - if (*chan_count <= 0) {
>> - dev_err(&pdev->dev,
>> - "failed to find any magnetic channels setup\n");
>> + if (*chan_count <= 0)
>> return -EINVAL;
>> - }
>
>Same question here.

*chan_count is the number of IIO channels successfully configured from the discovered HID attributes.

>