From patchwork Wed May 1 19:32:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1093798 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=prevas.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.se header.i=@prevas.se header.b="rAvwQbmD"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44vT7Y1Z4Nz9sB8 for ; Thu, 2 May 2019 05:32:41 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726270AbfEATcT (ORCPT ); Wed, 1 May 2019 15:32:19 -0400 Received: from mail-eopbgr30097.outbound.protection.outlook.com ([40.107.3.97]:30801 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726004AbfEATcS (ORCPT ); Wed, 1 May 2019 15:32:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rnxtyj++f02Wi2AVk8CMMce9pi5kjZu/IIfuRB/SUxk=; b=rAvwQbmDbmX0+YD2BldpAdKRQf85qZmxIKjAzkqpOvLv9IYJHq0TgLWUMtIJiq3a86/3XENdTKhpON2VbQjbTiUTS1zK1wDKRJdPWzM+1AKafYO1tKaTGMlJH+W3ry7/1IIojGwK/a3oXLnHLEjQS4NPcWYBbvWU/ry76m8doIE= Received: from VI1PR10MB2672.EURPRD10.PROD.OUTLOOK.COM (20.178.126.212) by VI1PR10MB2382.EURPRD10.PROD.OUTLOOK.COM (20.177.62.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.15; Wed, 1 May 2019 19:32:11 +0000 Received: from VI1PR10MB2672.EURPRD10.PROD.OUTLOOK.COM ([fe80::48b8:9cff:182:f3d8]) by VI1PR10MB2672.EURPRD10.PROD.OUTLOOK.COM ([fe80::48b8:9cff:182:f3d8%2]) with mapi id 15.20.1856.008; Wed, 1 May 2019 19:32:11 +0000 From: Rasmus Villemoes To: Andrew Lunn , Vivien Didelot CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "David S. Miller" , Florian Fainelli , Rasmus Villemoes Subject: [RFC PATCH 2/5] net: dsa: mv88e6xxx: rename smi read/write functions Thread-Topic: [RFC PATCH 2/5] net: dsa: mv88e6xxx: rename smi read/write functions Thread-Index: AQHVAFSSX8ZksdA+AkirAMJMhwKcSg== Date: Wed, 1 May 2019 19:32:11 +0000 Message-ID: <20190501193126.19196-3-rasmus.villemoes@prevas.dk> References: <20190501193126.19196-1-rasmus.villemoes@prevas.dk> In-Reply-To: <20190501193126.19196-1-rasmus.villemoes@prevas.dk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0902CA0005.eurprd09.prod.outlook.com (2603:10a6:3:e5::15) To VI1PR10MB2672.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:e3::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Rasmus.Villemoes@prevas.se; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [5.186.118.63] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 897211a6-4900-47dc-08a9-08d6ce6bb4d3 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:VI1PR10MB2382; x-ms-traffictypediagnostic: VI1PR10MB2382: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 00246AB517 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39850400004)(396003)(136003)(346002)(376002)(189003)(199004)(81166006)(6512007)(14454004)(186003)(50226002)(8676002)(107886003)(66066001)(3846002)(71190400001)(4326008)(6116002)(8976002)(478600001)(54906003)(81156014)(1076003)(8936002)(25786009)(71446004)(72206003)(316002)(73956011)(71200400001)(305945005)(74482002)(68736007)(66476007)(76176011)(44832011)(486006)(64756008)(53936002)(66446008)(66556008)(14444005)(256004)(99286004)(110136005)(6436002)(446003)(386003)(476003)(11346002)(6486002)(7736002)(26005)(6506007)(42882007)(2906002)(66946007)(2616005)(36756003)(52116002)(102836004)(5660300002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR10MB2382; H:VI1PR10MB2672.EURPRD10.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: prevas.se does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WNaEWga0lwxROfnHLrbo5ScqK3CNx/mhdqPpxqedpCEhjbBl28h8nbXcshIscTCOQrg2OcEcBVY2L4iP0nSoM8PbiepNmfmJQXp145GulAEfmkknpOmfHfWEPF+ypzwfIqzBFIH4vIr9spy+fiXiez4v2pOPm9lpt63ZE72mzSmR0zLyCoaQ2BtYJOvAWsVlLPMWFnJQ0KRKPJPHEExc3+MXotFPwZgoIYommAtcHVOLHaf4Cnjvlerq0p5nDJ+XLsS1praSJ00PWk0pzsIP8k0UQfNrZZtILznkCDBBWtND4JlBQwKjk1hn/tT/7W1nicfhFPDV7qpaUd/W3ZtfgwdaJQ5yvYKJdoQXoTeIrs0T/7SVYKfHO6j7xWI4PiMT3qfLmO2hdYzi6fayoNyOUuGvNWSBRYewCA43D8GFDP8= MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-Network-Message-Id: 897211a6-4900-47dc-08a9-08d6ce6bb4d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2019 19:32:11.4098 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2382 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org With the previous patch adding support for two chips using direct SMI addressing, the smi_single_chip_{read,write} functions are slightly misnamed. Changing to smi_dual_chip_{read,write} would not be accurate either. Change the names to reflect how the access to the SMI registers is done (direct/indirect) rather than the number of chips that can be connected to the same SMI master. No functional change. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.c | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index f66daa77774b..d8d8230a6bf5 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -86,8 +86,8 @@ static int mv88e6xxx_smi_write(struct mv88e6xxx_chip *chip, return chip->smi_ops->write(chip, addr, reg, val); } -static int mv88e6xxx_smi_single_chip_read(struct mv88e6xxx_chip *chip, - int addr, int reg, u16 *val) +static int mv88e6xxx_smi_direct_read(struct mv88e6xxx_chip *chip, + int addr, int reg, u16 *val) { int ret; @@ -100,8 +100,8 @@ static int mv88e6xxx_smi_single_chip_read(struct mv88e6xxx_chip *chip, return 0; } -static int mv88e6xxx_smi_single_chip_write(struct mv88e6xxx_chip *chip, - int addr, int reg, u16 val) +static int mv88e6xxx_smi_direct_write(struct mv88e6xxx_chip *chip, + int addr, int reg, u16 val) { int ret; @@ -112,12 +112,12 @@ static int mv88e6xxx_smi_single_chip_write(struct mv88e6xxx_chip *chip, return 0; } -static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_single_chip_ops = { - .read = mv88e6xxx_smi_single_chip_read, - .write = mv88e6xxx_smi_single_chip_write, +static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_direct_ops = { + .read = mv88e6xxx_smi_direct_read, + .write = mv88e6xxx_smi_direct_write, }; -static int mv88e6xxx_smi_multi_chip_wait(struct mv88e6xxx_chip *chip) +static int mv88e6xxx_smi_indirect_wait(struct mv88e6xxx_chip *chip) { int ret; int i; @@ -134,13 +134,13 @@ static int mv88e6xxx_smi_multi_chip_wait(struct mv88e6xxx_chip *chip) return -ETIMEDOUT; } -static int mv88e6xxx_smi_multi_chip_read(struct mv88e6xxx_chip *chip, - int addr, int reg, u16 *val) +static int mv88e6xxx_smi_indirect_read(struct mv88e6xxx_chip *chip, + int addr, int reg, u16 *val) { int ret; /* Wait for the bus to become free. */ - ret = mv88e6xxx_smi_multi_chip_wait(chip); + ret = mv88e6xxx_smi_indirect_wait(chip); if (ret < 0) return ret; @@ -151,7 +151,7 @@ static int mv88e6xxx_smi_multi_chip_read(struct mv88e6xxx_chip *chip, return ret; /* Wait for the read command to complete. */ - ret = mv88e6xxx_smi_multi_chip_wait(chip); + ret = mv88e6xxx_smi_indirect_wait(chip); if (ret < 0) return ret; @@ -165,13 +165,13 @@ static int mv88e6xxx_smi_multi_chip_read(struct mv88e6xxx_chip *chip, return 0; } -static int mv88e6xxx_smi_multi_chip_write(struct mv88e6xxx_chip *chip, - int addr, int reg, u16 val) +static int mv88e6xxx_smi_indirect_write(struct mv88e6xxx_chip *chip, + int addr, int reg, u16 val) { int ret; /* Wait for the bus to become free. */ - ret = mv88e6xxx_smi_multi_chip_wait(chip); + ret = mv88e6xxx_smi_indirect_wait(chip); if (ret < 0) return ret; @@ -187,16 +187,16 @@ static int mv88e6xxx_smi_multi_chip_write(struct mv88e6xxx_chip *chip, return ret; /* Wait for the write command to complete. */ - ret = mv88e6xxx_smi_multi_chip_wait(chip); + ret = mv88e6xxx_smi_indirect_wait(chip); if (ret < 0) return ret; return 0; } -static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_multi_chip_ops = { - .read = mv88e6xxx_smi_multi_chip_read, - .write = mv88e6xxx_smi_multi_chip_write, +static const struct mv88e6xxx_bus_ops mv88e6xxx_smi_indirect_ops = { + .read = mv88e6xxx_smi_indirect_read, + .write = mv88e6xxx_smi_indirect_write, }; int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val) @@ -4553,9 +4553,9 @@ static int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip, struct mii_bus *bus, int sw_addr) { if (sw_addr == 0 || chip->info->dual_chip) - chip->smi_ops = &mv88e6xxx_smi_single_chip_ops; + chip->smi_ops = &mv88e6xxx_smi_direct_ops; else if (chip->info->multi_chip) - chip->smi_ops = &mv88e6xxx_smi_multi_chip_ops; + chip->smi_ops = &mv88e6xxx_smi_indirect_ops; else return -EINVAL;