From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: "Baojun Xu" <baojun.xu@ti.com>,
linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org,
"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Mika Westerberg" <westeri@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v1 1/2] i2c: acpi: Return -ENOENT when no resources found in i2c_acpi_client_count()
Date: Tue, 25 Nov 2025 12:10:59 +0200 [thread overview]
Message-ID: <aSWAs71tl5s9_Rup@smile.fi.intel.com> (raw)
In-Reply-To: <20251125095046.GB323117@black.igk.intel.com>
On Tue, Nov 25, 2025 at 10:50:46AM +0100, Mika Westerberg wrote:
> On Tue, Nov 25, 2025 at 10:40:11AM +0100, Andy Shevchenko wrote:
> > Some users want to return an error to the upper layers when
> > i2c_acpi_client_count() returns 0. Follow the common pattern
> > in such cases, i.e. return -ENOENT instead of 0.
>
> Well what does 0 mean then?
There is no 0.
> To me it's logical that i2c_acpi_client_count() as it returns count,
> returns 0 if the count is 0. Let's not make it any more complex than that.
> ;-)
The same approach used elsewhere, e.g., gpiod_count(),
of_reset_control_get_count() / reset_control_get_count().
And other count methods used for IRQ resource, for example.
However PCI MSI/MSI-X counters never return 0.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-11-25 10:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 9:40 [PATCH v1 0/2] i2c: acpi: Ad-hoc cleanup and kernel-doc fix Andy Shevchenko
2025-11-25 9:40 ` [PATCH v1 1/2] i2c: acpi: Return -ENOENT when no resources found in i2c_acpi_client_count() Andy Shevchenko
2025-11-25 9:50 ` Mika Westerberg
2025-11-25 10:10 ` Andy Shevchenko [this message]
2026-05-19 9:47 ` Wolfram Sang
2025-11-25 9:40 ` [PATCH v1 2/2] platform/x86: serial-multi-instantiate: Remove duplicate check Andy Shevchenko
2025-11-27 9:54 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aSWAs71tl5s9_Rup@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=baojun.xu@ti.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=westeri@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.