From patchwork Wed Apr 13 23:59:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 610323 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qlgn22wHNz9t3n for ; Thu, 14 Apr 2016 10:01:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755169AbcDNABH (ORCPT ); Wed, 13 Apr 2016 20:01:07 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:55183 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185AbcDNABG (ORCPT ); Wed, 13 Apr 2016 20:01:06 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.80) (envelope-from ) id 1aqUhU-0005NO-VF; Thu, 14 Apr 2016 02:00:00 +0200 From: Andrew Lunn To: David Miller Cc: Florian Fainelli , netdev , Vivien Didelot , Andrew Lunn Subject: [PATCH net-next 8/8] dsa: mv88e6131: Don't special case a single device Date: Thu, 14 Apr 2016 01:59:58 +0200 Message-Id: <1460591998-20598-9-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1460591998-20598-1-git-send-email-andrew@lunn.ch> References: <1460591998-20598-1-git-send-email-andrew@lunn.ch> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When multiple switches are interconnected in a tree, a routing table is used for directing packets out the correct port towards a remote destination. This works equally well for a single switch, since the routing table is empty. So don't special case for a single switch. This makes the mv88e6131 behave like the other drivers. Signed-off-by: Andrew Lunn --- drivers/net/dsa/mv88e6131.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/dsa/mv88e6131.c b/drivers/net/dsa/mv88e6131.c index 969f67c77835..c7ee11f73be6 100644 --- a/drivers/net/dsa/mv88e6131.c +++ b/drivers/net/dsa/mv88e6131.c @@ -74,18 +74,12 @@ static int mv88e6131_setup_global(struct dsa_switch *ds) if (ret) return ret; - /* Disable cascade port functionality unless this device - * is used in a cascade configuration, and set the switch's - * DSA device number. + /* Set the switch's DSA device number and enable the use of + * the routing table. */ - if (ds->dst->pd->nr_chips > 1) - ret = mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2, - GLOBAL_CONTROL_2_MULTIPLE_CASCADE | - (ds->index & 0x1f)); - else - ret = mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2, - GLOBAL_CONTROL_2_NO_CASCADE | - (ds->index & 0x1f)); + ret = mv88e6xxx_reg_write(ps, REG_GLOBAL, GLOBAL_CONTROL_2, + GLOBAL_CONTROL_2_MULTIPLE_CASCADE | + (ds->index & 0x1f)); if (ret) return ret;