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

From: Andy Shevchenko

Date: Mon Nov 30 2026 - 12:16:24 EST


On Mon, Nov 30, 2026 at 10:34:24PM +0530, Sanjay Chitroda wrote:
> 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:

...

> >> - 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.

What is the negative meaning?

...

> >> 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.

It doesn't answer the question.

--
With Best Regards,
Andy Shevchenko