Re: [PATCH v2 net-next v2 08/12] net: dsa: mv88e6xxx: read switch ID from info

2016-06-14 Thread Vivien Didelot
Hi, Sergei Shtylyov writes: >> -id = mv88e6xxx_reg_read(ps, REG_PORT(0), PORT_SWITCH_ID); >> +of_id = of_match_node(mv88e6xxx_of_id_table, np); > > You could use of_device_get_match_data() here. > >> +if (!of_id) >> +return -EINVAL; >> + >> +info = (const struct m

Re: [PATCH v2 net-next v2 08/12] net: dsa: mv88e6xxx: read switch ID from info

2016-06-14 Thread Sergei Shtylyov
Hello. On 06/14/2016 09:31 PM, Vivien Didelot wrote: Retrieve the info structure of the compatible of device in the new probe function, in order to know how to access the switch ID register. That way, a compatible info can be used to describe how to access the switch registers on models with d

[PATCH v2 net-next v2 08/12] net: dsa: mv88e6xxx: read switch ID from info

2016-06-14 Thread Vivien Didelot
Retrieve the info structure of the compatible of device in the new probe function, in order to know how to access the switch ID register. That way, a compatible info can be used to describe how to access the switch registers on models with different registers layout or addressing modes. Signed-of