Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbcDOTOA (ORCPT ); Fri, 15 Apr 2016 15:14:00 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:57991 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbcDOTN7 (ORCPT ); Fri, 15 Apr 2016 15:13:59 -0400 Date: Fri, 15 Apr 2016 21:13:57 +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 net-next 3/7] net: dsa: mv88e6xxx: add switch info Message-ID: <20160415191357.GB18523@lunn.ch> References: <1460744750-13896-1-git-send-email-vivien.didelot@savoirfairelinux.com> <1460744750-13896-4-git-send-email-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460744750-13896-4-git-send-email-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 Content-Length: 1572 Lines: 38 On Fri, Apr 15, 2016 at 02:25:46PM -0400, Vivien Didelot wrote: > Add a new switch info structure which will be later extended to store > switch models static information, such as product number, name, number > of ports, number of databases, etc. > > Merge the lookup function in the probing code, so that we avoid multiple > checking of the MII bus, as well a multiple ID reading. > > Signed-off-by: Vivien Didelot > --- > drivers/net/dsa/mv88e6123.c | 8 +++--- > drivers/net/dsa/mv88e6131.c | 10 +++---- > drivers/net/dsa/mv88e6171.c | 10 +++---- > drivers/net/dsa/mv88e6352.c | 14 +++++----- > drivers/net/dsa/mv88e6xxx.c | 67 +++++++++++++++++++-------------------------- > drivers/net/dsa/mv88e6xxx.h | 14 ++++++---- > 6 files changed, 58 insertions(+), 65 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6123.c b/drivers/net/dsa/mv88e6123.c > index 00c1121..02bf16c 100644 > --- a/drivers/net/dsa/mv88e6123.c > +++ b/drivers/net/dsa/mv88e6123.c > @@ -17,10 +17,10 @@ > #include > #include "mv88e6xxx.h" > > -static const struct mv88e6xxx_switch_id mv88e6123_table[] = { > - { PORT_SWITCH_ID_6123, "Marvell 88E6123" }, > - { PORT_SWITCH_ID_6161, "Marvell 88E6161" }, > - { PORT_SWITCH_ID_6165, "Marvell 88E6165" }, > +static const struct mv88e6xxx_info mv88e6123_table[] = { > + { MV88E6XXX_INFO(0x121, "Marvell 88E6123") }, > + { MV88E6XXX_INFO(0x161, "Marvell 88E6161") }, > + { MV88E6XXX_INFO(0x165, "Marvell 88E6165") }, Why replace PORT_SWITCH_ID_6123 with the magic number 0x121? Andrew