From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbcFNW0u (ORCPT ); Tue, 14 Jun 2016 18:26:50 -0400 Received: from mail.savoirfairelinux.com ([208.88.110.44]:39381 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932239AbcFNW0s (ORCPT ); Tue, 14 Jun 2016 18:26:48 -0400 From: Vivien Didelot To: Andrew Lunn 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 In-Reply-To: <20160614220435.GI12832@lunn.ch> References: <20160614183153.32327-1-vivien.didelot@savoirfairelinux.com> <20160614183153.32327-12-vivien.didelot@savoirfairelinux.com> <20160614220435.GI12832@lunn.ch> User-Agent: Notmuch/0.22 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) Date: Tue, 14 Jun 2016 18:26:44 -0400 Message-ID: <87y467z9sr.fsf@ketchup.mtl.sfl> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, Andrew Lunn writes: >> +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. That's why I keep it simple for the moment. The low-level API using ps is now _mv88e6xxx_reg_{read,write}. I can rename them to mv88e6xxx_smi_{read,write} in v3 or later. Thanks, Vivien