On Wed, Oct 03, 2018 at 03:51:32PM +0200, Felix Fietkau wrote: > >> > } > >> > > >> > put them into mt76xN_dev and still remove dupicated code ? > >> Quite often, mt76_dev would be needed as well for register access, which means extra parameters for a lot of functions. > >> I think Lorenzo’s approach makes the code a lot more concise, and makes it easier to share more code between mt76x0 and mt76x2. > > > > I think this could be solved very easly by container_of() macro if > > there will be one mt76x02_dev struct just after mt76_dev. > That's possible, yes. But given how much code can still be unified > between mt76x0 and mt76x2, I don't think there will be much need for a > x0 or x2 specific device struct. And in that case, the code will be more > readable if we avoid putting a lot of unnecessary &dev->mt76x02 or > container_of in the code. Ok, I guess can live with mt76x02_dev :-) Thanks Stanislaw