[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ink7oh1h.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
Date: Wed, 07 Jun 2017 13:15:38 -0400
From: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: netdev <netdev@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>,
John Crispin <john@...ozen.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next v2 5/5] net: dsa: Stop accessing ds->dst->cpu_dp in drivers
Hi Florian,
Florian Fainelli <f.fainelli@...il.com> writes:
>> So as I said in v2, now that a driver is guaranteed that dp->cpu_dp is
>> correctly assigned at setup time, isn't better (especially for future
>> multi-CPU support) to provide an helper which returns the CPU port for a
>> given port? i.e. dsa_get_cpu_port(struct dsa_switch *ds, int port).
>>
>> Or is there something blocking? I might be wrong.
>
> mt7530.c needs access to the CPU port at ops->setup() time which is
> why this is still here.
Yes, mt7530 is the only one doing this and has an hardcoded CPU port. So
what I meant was, shouldn't we have this instead:
struct dsa_port *dsa_get_cpu_port(struct dsa_switch *ds, int port)
{
return ds->ports[port].cpu_dp;
}
And:
- dn = ds->dst->cpu_dp->netdev->dev.of_node->parent;
+ cpu_dp = dsa_get_cpu_port(ds, MT7530_CPU_PORT);
+ dn = cpu_dp->netdev->dev.of_node->parent;
Thanks,
Vivien
Powered by blists - more mailing lists