Re: [PATCH net-next v3 2/3] net: phy: mscc: Consolidate probe functions into a common helper
From: Lad, Prabhakar
Date: Wed Nov 12 2025 - 08:54:13 EST
Hi Geert,
Thank you for the review.
On Wed, Nov 12, 2025 at 8:53 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>
> Hi Prabhakar,
>
> On Tue, 11 Nov 2025 at 10:11, Prabhakar <prabhakar.csengg@xxxxxxxxx> wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> >
> > 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@xxxxxxxxxxxxxx>
> > ---
> > v2->v3:
> > - Grouped check_rate_magic check
>
> Thanks for your patch!
>
> > --- 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.
>
Ok, I'll sort it in v4.
Cheers,
Prabhakar