Thread (28 messages) 28 messages, 5 authors, 5d ago

Re: [PATCH v5 2/6] PCI: spacemit-k1: Add multiple PHY handles support

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2026-09-09 14:27:15
Also in: linux-pci, linux-riscv, lkml, spacemit

On Wed, Sep 09, 2026 at 04:00:15PM +0800, Inochi Amaoto wrote:
On Tue, Sep 08, 2026 at 01:29:27PM +0300, Andy Shevchenko wrote:
quoted
On Mon, Sep 07, 2026 at 07:26:01PM +0800, Inochi Amaoto wrote:
...

quoted
quoted
+	count = devm_of_phy_bulk_get_all(dev, node, &k1->phys);
+	if (count < 0)
+		return count;
+	if (count == 0 || count > data->max_phy_count)
+		return -EINVAL;
Elsewhere we distinguish count == 0 with -ENOENT.
Is there is an example? I think it is suitable for its internal check 
to translate -ENOENT to count 0, because no phys property means no
phy. For a get helper with optional semantics. I think it is fine
to return 0.
This the brief list of what I roughly grepped with word "count" in the name.

gpiod_count()
of_hte_req_count()
i2c_acpi_resource_count()
ice_sriov_set_msix_vec_count()
reset_control_get_count()

-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help