Thread (13 messages) flat view 13 messages, 4 authors, 2025-11-12

Re: [PATCH net-next v3 2/3] net: phy: mscc: Consolidate probe functions into a common helper

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2025-11-12 08:49:41
Also in: linux-renesas-soc, lkml

Hi Prabhakar,

On Tue, 11 Nov 2025 at 10:11, Prabhakar [off-list ref] wrote:
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Unify the probe implementations of the VSC85xx PHY family into a single
vsc85xx_probe_common() helper. The existing probe functions for the
vsc85xx, vsc8514, vsc8574, and vsc8584 variants contained almost
identical initialization logic, differing only in configuration
parameters such as the number of LEDs, supported LED modes, hardware
statistics, and PTP support.

Introduce a vsc85xx_probe_config structure to describe the per-variant
parameters, and move all common setup code into the shared helper. Each
variant's probe function now defines a constant configuration instance
and calls vsc85xx_probe_common().

Also mark the default LED mode array parameter as const to match its
usage.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v2->v3:
- Grouped check_rate_magic check
Thanks for your patch!
quoted hunk ↗ jump to hunk
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -22,6 +22,24 @@
 #include "mscc_serdes.h"
 #include "mscc.h"

+struct vsc85xx_probe_config {
+       const struct vsc85xx_hw_stat *hw_stats;
+       u8 nleds;
+       u16 supp_led_modes;
+       size_t nstats;
+       bool use_package;
+       size_t shared_size;
+       bool has_ptp;
+       bool check_rate_magic;
+};
Please sort by decreasing size, to reduce holes:
  1. pointer and size_t,
  2. u16,
  3. u8 and bool.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help