From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752323AbcFNWEj (ORCPT ); Tue, 14 Jun 2016 18:04:39 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:46240 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751442AbcFNWEi (ORCPT ); Tue, 14 Jun 2016 18:04:38 -0400 Date: Wed, 15 Jun 2016 00:04:35 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH v2 net-next v2 11/12] net: dsa: mv88e6xxx: add an SMI ops structure Message-ID: <20160614220435.GI12832@lunn.ch> References: <20160614183153.32327-1-vivien.didelot@savoirfairelinux.com> <20160614183153.32327-12-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160614183153.32327-12-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +struct mv88e6xxx_smi_ops { > + int (*read)(struct mii_bus *bus, int sw_addr, > + int addr, int reg, u16 *val); > + int (*write)(struct mii_bus *bus, int sw_addr, > + int addr, int reg, u16 val); > +}; > + I think this API would be better if it used ps, not bus and sw_addr. The only problem is the very first read to get the switch ID. I would add one more layer in between, so that you can call the lowest level functions without having a ps structure. Andrew