Re: [PATCH net-next v3 9/9] net: sunhme: Consolidate common probe tasks

Simon Horman
2023-03-21T08:00:28Z

On Sat, Mar 18, 2023 at 10:40:46AM -0400, Sean Anderson wrote:
> On 3/18/23 09:53, Simon Horman wrote:
> > On Mon, Mar 13, 2023 at 08:36:13PM -0400, Sean Anderson wrote:
> > > Most of the second half of the PCI/SBUS probe functions are the same.
> > > Consolidate them into a common function.
> > >
> > > Signed-off-by: Sean Anderson <seanga2@gmail.com>

...

> > > @@ -2511,70 +2576,18 @@ static int happy_meal_sbus_probe_one(struct platform_device *op, int is_qfe)
> > > goto err_out_clear_quattro;
> > > }
> > > - hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
> > > - if (hp->hm_revision == 0xff)
> > > - hp->hm_revision = 0xa0;
> >
> > It's not clear to me that the same value will be set by the call to
> > happy_meal_common_probe(hp, dp, 0); where the logic is:
> >
> > #ifdef CONFIG_SPARC
> > hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff);
> > if (hp->hm_revision == 0xff)
> > hp->hm_revision = 0xc0 | minor_rev;
>
> OK, so maybe this should be xor, with sbus passing in 0x30.

Maybe moving the math to the caller makes things easier.
I'm unsure.

> > #else
> > /* works with this on non-sparc hosts */
> > hp->hm_revision = 0x20;
> > #endif
> >
> > I am assuming that the SPARC logic is run.
> > But another question: is it strictly true that SBUS means SPARC?
>
> Yes.

Thanks, got it.