lkml.org 
[lkml]   [2021]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [net-next PATCH 05/19] net: dsa: qca8k: move read switch id function in qca8k_setup
On Fri, Nov 19, 2021 at 02:08:59AM +0100, Ansuel Smith wrote:
> On Fri, Nov 19, 2021 at 03:03:05AM +0200, Vladimir Oltean wrote:
> > On Wed, Nov 17, 2021 at 10:04:37PM +0100, Ansuel Smith wrote:
> > > Move read_switch_id function in qca8k_setup in preparation for regmap
> > > conversion. Sw probe should NOT contain function that depends on reading
> > > from switch regs.
> >
> > It shouldn't? Why? We have plenty of switch drivers that use regmap in
> > the probe function.
> >
>
> The initial idea was to make a shared probe function. (when the ipq40xx
> code will be proposed)
> Currently the regmap is init in the setup function so we can both
> move the switch id to setup or move regmap to probe.
> What should be better in your opinion?

Either one is fine, but it seems a bit backwards to call
dsa_register_switch() only to find out later, during the ->setup()
callback, that you're in fact talking to a potato. So from that point of
view maybe you could keep the device id check in ->probe, and therefore
also move the regmap initialization there.

\
 
 \ /
  Last update: 2021-11-21 19:35    [W:0.226 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site