From patchwork Fri Oct 22 15:59:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12578093 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 760B1C433F5 for ; Fri, 22 Oct 2021 15:59:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5ACD56109E for ; Fri, 22 Oct 2021 15:59:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233440AbhJVQBz (ORCPT ); Fri, 22 Oct 2021 12:01:55 -0400 Received: from mail-db8eur05on2043.outbound.protection.outlook.com ([40.107.20.43]:18401 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233397AbhJVQBy (ORCPT ); Fri, 22 Oct 2021 12:01:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IiZIHwXEv5coaYBvrudOAXxViinkfjS/TpKhlUCHTGNtoZ2yTppxofYHWhjm05fxhuQTVrSqNTVEo+U1ipNL2qgWQx4G00WfI7CCj02kEFC7sCSauJvsJQs4ajIOYO0Zb30RLneZAbb9oupTLYRVDUWgyFos7r3sfziQWQUnv5zy1xoKVJtODUNHS15GCy56IqSesKF4fivYF0+9bdHEFus722CXp5TRLjmJ5u2uA3wZgXnl2vBCxb9tp+L3BGM6YioqrUjh5JSrr5758gAVThl9V3075oyLv9TvtIgc37NOsG+CLdFTPrEw9TSQSxVQbZIsJ3L5hDvbSTgqoMo6OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WPhI3KxT9/D5GUvE27snbPDVBMlSev5/hgtRvCBOSRE=; b=NGjeZ1k/HYHHXRh1TE6n6cyS4FtHdPGNIKGQcze2IloA4SxCZYWukcrzE4Bt0eCeCo04FoObs9aTDaN51GN6t/tBFuPh5tWIGQ219xhZILpHd4yP5Q6fESHPSDACSw3Vpx95tV+9SW/AKnhj5KMb7uAtNvjFJPr+xDtC/pG3huMYepJKnePTrjnaTclnpMGSa6O+2wbSCRII4PcDMsyiC6IGI9qs6UaGGVXVzQ5kBMWY+3a7Hrl7iGBlPZSCDbEP3bjh2sY+zquif9eAE2KI9VAV+5mSjwiPrFT3pqwNjiPGs46Yl5VLQLEpY5E/y03QUBBzOY4yYg65GknjDR8KHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WPhI3KxT9/D5GUvE27snbPDVBMlSev5/hgtRvCBOSRE=; b=Uj705oisv3uchxYXXWHEN98yYx3/xR5I1Je83fLQFGf3BkBFLc23tQg0hEYyoibzHnlOjanxQXMWNdktFqR7XV5Wv78u0OWPsL9U9tUB6CRKk/XEtccWBZ8kbcbgC0E5tOdpJzoGKnDXHeq5X91NWygT973Dn/xuF0ru6XNxukE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DB7PR03MB4522.eurprd03.prod.outlook.com (2603:10a6:10:1a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Fri, 22 Oct 2021 15:59:34 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf%6]) with mapi id 15.20.4608.018; Fri, 22 Oct 2021 15:59:34 +0000 From: Sean Anderson To: netdev@vger.kernel.org, Andrew Lunn , Heiner Kallweit Cc: Russell King , linux-kernel@vger.kernel.org, Jakub Kicinski , "David S . Miller" , Sean Anderson Subject: [net-next PATCH v2 1/3] net: mdio: Add helper functions for accessing MDIO devices Date: Fri, 22 Oct 2021 11:59:12 -0400 Message-Id: <20211022155914.3347672-1-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 Received: from plantagenet.inhand.com (50.195.82.171) by MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 15:59:32 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e4be131-ea99-47bd-d81d-08d99574f0ce X-MS-TrafficTypeDiagnostic: DB7PR03MB4522: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NrkStRtd+x7DmDzdZvY5w2Hvra5TO29/XO8hsi++4L3QRF20u8VHj70yosazJgfj5aHxZn8UL7q+GVaoGqUK+jcAfzRcTuQ9JRmq1twVFhG7QAD16CY4b+CbyzOoYPU5ga7yMKr6iB/YoNSIRsi0NEC6D+DIYcBZsjZeesnV35J0hAsy2b3vsZc5EJ3M0wDM+RLkKMZmmo8qFoOyvpdarkN2IoHgh8OGkaKdLkZfpEW9mmsXNHEoA1yXGaN6t/fX3d5qKJSew0SJsj3dTw+oOZvx5fshKUb8V/dZft/R/8POp43gJiY5gt4DKSFFiR+TkcVxgYiTPkhvCn+EI5ixU8aFk6f03PrKdp/81hknWXkXnP5PEyIxkfCRCXxpj4Poc4ZcLEbaN2KV+C8PjtGb5PRHMLaI5oVzhErdwwRVJpON6xA1wLM12zgS7ij479Ob889EiFHqG58aRAW6WnXxAIcV8BthkYhugHVGNgFkzTkP4MxL6rYQapOGYjUTfTYwwPS0xg04eTmPCXVNXYm/vB/tBLRTudWmiy6sic8ERmHOUKOOIuyJh3qbZ07xFGZDHlue8EXDu0kTf/Ii+3hS+iw4DwpxLNbkgkO5usj2Yv5gHVOANVgnBfmWlmeWb3NlGdjAmYZcPtfwdraTBVu4ETWtN4FWpfEOoJ0P0EyjE+GIGoGc47VuJe8VJCRLtolDtn9FgsqayoPoe6XjHMTbY8BKkz3fkIZu38ZX8dBqtnLSOMWNi4rQEAwlJYHWba/eVwLcwzGsmY4Vv4bE33MxPlJR5Yyr8WjjYr0Aprae/84= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4523.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(8936002)(110136005)(2906002)(26005)(83380400001)(66946007)(6486002)(6506007)(54906003)(5660300002)(52116002)(86362001)(186003)(508600001)(4326008)(66476007)(36756003)(8676002)(66556008)(6666004)(44832011)(966005)(2616005)(956004)(38100700002)(38350700002)(107886003)(1076003)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /uAGd3hKl9BFJW2c9gUbYZaEn4Ftd8gJ6NyndY3gBU7IROg1uEJC4Po+G+C6cAhIrTk2VKEVMKkNOpcwSueqyF8rHBP0P2Xn+zyfaS+OplD4bWqFnSRpWgsW7HdOf998b15tXBKxB/SzB1wlZPZb2sNxWD0a5nt2uufozy5nugheBtJC7SEtqPZsLOA6PCExJ/GUBFOCto4E+Kao1bd1DvKTm25QTMJdCzQ3ZvIEOAJE9iY3XXlAkWL8tmYhni2hLnwwaRUZf0u0TV2wbYk2AqanzK2ylRu1gwsaOje72N9S04ClpcBwCCPe9Ox3Qk1Ci+stKJsTaUiqoI4cqBDLwIW8uZQFzMbjG7pfZribXZ5T9s91zaenCw5bcnStvoL+5uwC4T0MvqwGKYpt5TcY3aSM3zNf8G47ny2HFE/Xn4lLgMGeAKApj6TLU5cbBqNgnNH+Zb3ovXI8CqrB8abvOJh2dW/lx96tF6NTq4CVDMyGZkRZVt3rgiL4dI5KPqY/B67OUdXA1LyfxZSaKPwcObTUaPKOZCCykXlG4sUzTAKsyA8hTHctn2q43eGuFVCWX9TdtiFUJrNesMOLNShnZ82lpE0YobNqj0uzM33p1KBM7ICKkLds49dVy6TtU9Vl9WXAv0MTQ6vSaQjEybYyj1JQfZSUhIbu6n01IEJ5NO2W0NcWg+LNJYAWpgJfdQ+GLtKg9tvGPBVbD3hzCZupvcgtEYPYOuUfHp1+VeekDObeQ/cidqr2L4MIRUZKrOE0YGbtVD6L1rl3jufgi7QWttvE1DMyWjgZAu4WbFYn7HfTPO1FMJ7mjQUpOlFKHg3GBFrqKelrPeaame2+FFPwY8+Y8fA+Qv0JTFw7kz30D7hlucxDAY5fgbvu3JFAOMy592HWYU0ejJXb3j4z4TEVRXxUhmchyIdM+RnOu6TqQXYOG52O3PL59Wtn4ZYw5EDCXABRvUy+kOP2TRoeOI/vRO0+xOwJHLLlPar/Ceq9azq0T10+zZ+4Z+rhxIHI4tN9l1ROY0/tnW3N8jfgK1cO1ut2HHbq/vsXMm410L7zTucqKito8ifwO/+FpY4jUmKx3s8r+rOLxXxFu3PrgMNi5raUjjaHxoRY65MntJzPH0bOej1csfS/eiMdr2jMFgej7Fj8QZCv+JDldpyLaUwJ9N1fo27zXT/MUyKGEWWl1CdiaVMys6AEYuGg8C4CzZXyvgDNNeNpnF9Jyd7oGxwayEv9RlcDEGwyG3J5YDmfVv2VgiamQnRFzZmuSCmI1gZai6U4EMtkKgyHX8Vhqzrmki+vKDENgJV8uqIKEod1zyWSNSomUQSc56wjWYR8JWxq X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e4be131-ea99-47bd-d81d-08d99574f0ce X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 15:59:33.9947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sean.anderson@seco.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4522 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This adds some helpers for accessing non-phy MDIO devices. They are analogous to phy_(read|write|modify), except that they take an mdio_device and not a phy_device. Signed-off-by: Sean Anderson Reviewed-by: Russell King (Oracle) --- This patch was originally submitted as [1]. [1] https://lore.kernel.org/netdev/20211004191527.1610759-15-sean.anderson@seco.com/ (no changes since v1) include/linux/mdio.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/linux/mdio.h b/include/linux/mdio.h index f622888a4ba8..9f3587a61e14 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h @@ -352,6 +352,30 @@ int mdiobus_modify(struct mii_bus *bus, int addr, u32 regnum, u16 mask, int mdiobus_modify_changed(struct mii_bus *bus, int addr, u32 regnum, u16 mask, u16 set); +static inline int mdiodev_read(struct mdio_device *mdiodev, u32 regnum) +{ + return mdiobus_read(mdiodev->bus, mdiodev->addr, regnum); +} + +static inline int mdiodev_write(struct mdio_device *mdiodev, u32 regnum, + u16 val) +{ + return mdiobus_write(mdiodev->bus, mdiodev->addr, regnum, val); +} + +static inline int mdiodev_modify(struct mdio_device *mdiodev, u32 regnum, + u16 mask, u16 set) +{ + return mdiobus_modify(mdiodev->bus, mdiodev->addr, regnum, mask, set); +} + +static inline int mdiodev_modify_changed(struct mdio_device *mdiodev, + u32 regnum, u16 mask, u16 set) +{ + return mdiobus_modify_changed(mdiodev->bus, mdiodev->addr, regnum, + mask, set); +} + static inline u32 mdiobus_c45_addr(int devad, u16 regnum) { return MII_ADDR_C45 | devad << MII_DEVADDR_C45_SHIFT | regnum; From patchwork Fri Oct 22 15:59:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12578095 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9BD4C4332F for ; Fri, 22 Oct 2021 15:59:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD40B61359 for ; Fri, 22 Oct 2021 15:59:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbhJVQB5 (ORCPT ); Fri, 22 Oct 2021 12:01:57 -0400 Received: from mail-db8eur05on2043.outbound.protection.outlook.com ([40.107.20.43]:18401 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230187AbhJVQBz (ORCPT ); Fri, 22 Oct 2021 12:01:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oCyFDo/moCfRYltnWai7Ey/voVeGD1VGAqVjrMxgOU+zUCLXVBFvAjvjmI36Zjlz1qQPFwF/wI5QhKgEsA5RxspktJixOGwneL2ygshdYHm5+JkFGhCDKQswKzEG/NhlYKY3O24Kqxop0mF+NUtSzfXQiuSoQpy/HKMafaZNOWCQxzQPlHRMGXaINAsHD/frukVbsZexoFnOBUfI+hlOQ1P4w7EDNVQz54Y2BZp/nRgLx0uqw6FiwLwIxINLTjM7MeBV36o3zmgaB0BZ1FJoZpuxVd8tbWHxN+/S4+5Gj1eAZYemqdEIPceYj4xmb/t9OOS6clSU8406zd736mKeXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JnDNcXDMTtLTNzsBJmcTZwUL6OmqiGDibpedwtA0ETo=; b=EQ0U/6G2zuyolZCNDmQTKxCjj64/j4y16htZDRMPqWh2wqWu9N9r97mpqnoOC+Mo65Oj1h1M3dsvZn+hhZ3AGgCK63nHh/jywPv8rV0IavcO4Y3UXOWyrVDo2clwli5nbNmezqftRMm8xAwCB11NnJ/v2ZmmxnQ/PkojPPFgkzZ7CAi0j6qKSIferN651eJgrKL2O02ihUDQvhZkHayah0/qPfWvRd1KD5VtDsxyU3+QSjx/1WHwHrdUod8J8Nv9oJeEudAULKKW8cjHNn0CTfhY9OsgTDCrnVF+8fpObhKX52In3rFQn/NxjXYYdaJtjDxiNm3DNCyiqQgh3nyG/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JnDNcXDMTtLTNzsBJmcTZwUL6OmqiGDibpedwtA0ETo=; b=S+BEwF7MaQsFnoqkCHpJnDSDQURwY56E1oeVBL37doRmstDUZc6FPCjjdCQ6OEgjU6WsFmubwiA+H0cKMx3rnplb0pDBDqLw7nHrOwuHstbMGUsFW5aRu4rMF4TwIeQdPR0/QvwSQVLpknSDw6ti0KHvUTVaNojU2S3HMsjN7P8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DB7PR03MB4522.eurprd03.prod.outlook.com (2603:10a6:10:1a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Fri, 22 Oct 2021 15:59:35 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf%6]) with mapi id 15.20.4608.018; Fri, 22 Oct 2021 15:59:35 +0000 From: Sean Anderson To: netdev@vger.kernel.org, Andrew Lunn , Heiner Kallweit Cc: Russell King , linux-kernel@vger.kernel.org, Jakub Kicinski , "David S . Miller" , Sean Anderson Subject: [net-next PATCH v2 2/3] net: phylink: Convert some users of mdiobus_* to mdiodev_* Date: Fri, 22 Oct 2021 11:59:13 -0400 Message-Id: <20211022155914.3347672-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022155914.3347672-1-sean.anderson@seco.com> References: <20211022155914.3347672-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 Received: from plantagenet.inhand.com (50.195.82.171) by MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 15:59:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3deef0dc-d822-4d2c-fbe5-08d99574f1bb X-MS-TrafficTypeDiagnostic: DB7PR03MB4522: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jy7OKSvW8w6iCwF8VofEfuT0Ybql8g49/FG8WwWXMPkNKL9EaSJQJmJcbVIq456dhRI0nxrijlL1HK4L3DNyUzIAc3iE9WzeauCBKF9EdY7ZEjc3hMmEJ7pCDi1IyHTGdTLwuTOXPtGcqiiUXq35ZjsdexShMicymJP6KCNOE9FNvQP7jSZA82mgS2pyQsB6N9+owtToETVRA8rrqN5yq1G5a/gCZNEHAyPXWqGjCpUj+3rXW9/yztowozVTcqaTFO0vMUcHv0VH2nN5hbJ6JT5xAIVx2BA1hhymkiiiX6n0QELsqoZmVpngeokChITDjETw4WJMPlcRI3w0csDwUejYT7itMJY+9O5s2WCk+wyIwH5gZlIJnweSyzUnAAsl5+EgmRcyWtvUZn+gfsrOsouXGLPUiKRA+z9eu+nPLa+n++QlpVBx2hgQzcU3Gf8bq0I4bCHInp7x+iFDwHOj3JGOfEQqqZM7YK6kb8Pr6Mk0wc7mKbpkHWGJBvQjmUtAOk6yIs3MzPSRDqwnBfwNrTHSFwh9Kjo2/roInBO8Sdx+m0nkh8zKjS2RxGawmGOd4y5Hc1TyqT108IcI+FfOXHWmyfy+dK0TLdsWwJlqcazAoR+tEFYTu0nD53COR/gBWccsaIy0FR3Z0phk4D8xfhsVkFaE1ENGOBh1iVoQT73NJOso72sSMmscI5y0zA5PlnYkGuy/oQ70HJ1Lvca6Cg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4523.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(8936002)(110136005)(2906002)(26005)(83380400001)(66946007)(6486002)(6506007)(54906003)(5660300002)(52116002)(86362001)(186003)(508600001)(4326008)(66476007)(36756003)(8676002)(66556008)(6666004)(44832011)(2616005)(956004)(38100700002)(38350700002)(107886003)(1076003)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Euno1TD7p9MV9AoXD7EQplunSxWuCCGGgKaVkwwFqsGWIN8wFFVtZyeUCG/ElxnwgvkMB0lwVWtwYDxyEvKy8rj6FImzC+t2O+jWHaQ5SYU34KqrztrrRFu1XEDDtiue/uRwTsoNX4LwHFXkXwn3XXaYGlA4OvaUGNan1uAE5IJFdJYpkjXoeOsmbPsduk/TJ+3kHQ+EPkuOYb0cjsNxkSMqa0N9Z0f5XqYrNkZFUBHwU0IvVUD8SmsK8x34jeVTeJ2g7Ny4RbpUwmxTG6wRUHrzrrlLOqFgJHgfsLPKBOpAKnjAZnfEh+0PxoxsRcWHVYjR7kus5KAI0086hsVALwQxyWcvHxEzZJlQQsIA8hI9FHO54SRA+ggcu4xixiou74qxU5vxPX1hAW7SLxgtVZOCEZKq7r8cY5C/FtGcDR9KGQ3pUjBLQB0h8JOY7h5PWtHfnxrQL5C+l9V1uM7Os3VXzs0YLSG3I31lVXVGzO5MwNrm0DyfqiRhcUrQI/+X961LaSxWhP1e99eqZFED500g/BEy5Ro8DoHKAeqMKSvG2K/YEFDXleSYvLQg1mI+/wvaA0Hu+X14iK4izD2etlvXY00tsHL3l8XU53k7eqF6yTLD/cby1jbfh8kFzta5UWpG9s/k4bIXc+eMlqYxLJxDtAYLMmURQS8p4706JNDO5vtCEbHFJDL3b0+OWzF7KHE4F0s0BSwyXwdUN46fpgbSUL6ylc34hEQiDDr7MqdmqFdgEBLFjwT8lsTowbUvrK3HbnKFFIq80fcjQlb1H4mpv2fQxPlvvE9+uiQE5eYRwYWfp77uqak464NuKptwhoEr44nNxt6xULuwoWlKb/JIBalmNEP6eOqnECuhGORtkB1K7MMuz/LS826F480Tb0ZhZqcznjVweUW9hKgaAC3XqEPkeQkEvPUNVQWTkbUxiEbgDET6vlKcwR/N53HF//GF/fuHBg37FezlB8Hcomf2EXIPHKdGUbS6Ufr1808BpUJNuse48WUCTiqkPKDTzax1Ko9d3JEbpr7oVLRvdnaPXteZMKILWihhDLZ84PnvNojcTYJD46mWNiHPsLdfhjzUdHNDNqjytrdI279GsVjMe9RCHu8A/ChYJ5G82sK4RMw28PuSDYqct4kp4pNWZz6/fd3Vh3mEKyq+HfBuTicTpQA7IMbWbCr8TvQj/qvCOZUT24aC0uHau1W76LPmB6jggWEa9pgw4lRopZ+slilCqOKZt1Bb/1fg3PymfGYdYltxeBj+5fltC2h+3MltDysQjHfsGO91CiVOoPSEsm1BOg+4pLWTPDZiLwhX7XdBu3gDr3YHGh+hcEVhV0f1 X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3deef0dc-d822-4d2c-fbe5-08d99574f1bb X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 15:59:35.5248 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sean.anderson@seco.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4522 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This refactors the phylink pcs helper functions to use mdiobus_* instead of mdiodev_*. Signed-off-by: Sean Anderson Reviewed-by: Russell King (Oracle) --- Changes in v2: - Rebased onto net-next/master drivers/net/phy/phylink.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 7e93d81fa5ad..14c7d73790b4 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -2542,12 +2542,10 @@ EXPORT_SYMBOL_GPL(phylink_decode_usxgmii_word); void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs, struct phylink_link_state *state) { - struct mii_bus *bus = pcs->bus; - int addr = pcs->addr; int bmsr, lpa; - bmsr = mdiobus_read(bus, addr, MII_BMSR); - lpa = mdiobus_read(bus, addr, MII_LPA); + bmsr = mdiodev_read(pcs, MII_BMSR); + lpa = mdiodev_read(pcs, MII_LPA); if (bmsr < 0 || lpa < 0) { state->link = false; return; @@ -2603,8 +2601,6 @@ int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs, phy_interface_t interface, const unsigned long *advertising) { - struct mii_bus *bus = pcs->bus; - int addr = pcs->addr; u16 adv; switch (interface) { @@ -2618,12 +2614,10 @@ int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs, advertising)) adv |= ADVERTISE_1000XPSE_ASYM; - return mdiobus_modify_changed(bus, addr, MII_ADVERTISE, - 0xffff, adv); + return mdiodev_modify_changed(pcs, MII_ADVERTISE, 0xffff, adv); case PHY_INTERFACE_MODE_SGMII: - return mdiobus_modify_changed(bus, addr, MII_ADVERTISE, - 0xffff, 0x0001); + return mdiodev_modify_changed(pcs, MII_ADVERTISE, 0xffff, 0x0001); default: /* Nothing to do for other modes */ @@ -2666,8 +2660,7 @@ int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode, else bmcr = 0; - ret = mdiobus_modify(pcs->bus, pcs->addr, MII_BMCR, - BMCR_ANENABLE | BMCR_ISOLATE, bmcr); + ret = mdiodev_modify(pcs, MII_BMCR, BMCR_ANENABLE | BMCR_ISOLATE, bmcr); if (ret < 0) return ret; @@ -2688,14 +2681,12 @@ EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_config); */ void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs) { - struct mii_bus *bus = pcs->bus; - int val, addr = pcs->addr; + int val = mdiodev_read(pcs, MII_BMCR); - val = mdiobus_read(bus, addr, MII_BMCR); if (val >= 0) { val |= BMCR_ANRESTART; - mdiobus_write(bus, addr, MII_BMCR, val); + mdiodev_write(pcs, MII_BMCR, val); } } EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_an_restart); From patchwork Fri Oct 22 15:59:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12578097 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AFB9C433F5 for ; Fri, 22 Oct 2021 15:59:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 045686103D for ; Fri, 22 Oct 2021 15:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233469AbhJVQCA (ORCPT ); Fri, 22 Oct 2021 12:02:00 -0400 Received: from mail-db8eur05on2043.outbound.protection.outlook.com ([40.107.20.43]:18401 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233484AbhJVQB5 (ORCPT ); Fri, 22 Oct 2021 12:01:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EeElO+0g5k3I3gfSMXMsnGNlA2xBY1d960BIWwPswhQegKr5cGo7wdsoEr3M4q7N5XvIess5NM6j3tXlfF9mfsXRhm2N5a3SPtT+FpyjGdfnsdTvjIZLYJn8ARwOV9wA5raFqVoKdwI6+u/ZHoPT5bxsc7eEdmlpzy3WbAwZhnvHWdZzZy1EOWyud18dQ+dxD55h49Ux6yc/o9iMh8gzyMLPI39gaqJDu3b5OSC8YCzBOaC3prXASgxlQmlGCNssgxGKsFgKsTUwGSRXXF5ecAmXMNECt2HyBTjQJtf8lQKLzN4qE4aV8XsSeC4tnGzcvhI18NHrfozZAQwg50S4GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Yv2UB8kq7sV3+P4J38XEo7u7FfpYsmn0ukb6hvA6iXA=; b=Iodj9pAwmLZtLX/+ncL3G9JSKzjos/R5sNTCYNdg0LulEKkm+d4WvZwWNAlYWMbEeBe0Bt+05v6fyXSRC0EPZ4PMOGtlK85xDfRFzTUJhjYuL7EYH/on7OWErMfOKZJCkDUX7HfS9KFhEbN6Dis/FqObVVzOnMectDw96FmF6V0q3Vz7nnlwVE8HTnvnkb/xPAWrhD8Z9ZxvnA0Sa5t4L2MC0ljEyngwgTsiaF28dGYnRkrdiAG0MLPTIcAv7LQlfgBxMEG7t1lnJfartajT1OD2sRSYLfHurdB+4ryECf6If8S1kN96BNu9BWAmC/KRwYKn2oqnYQydhWu+unDeBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secospa.onmicrosoft.com; s=selector2-secospa-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yv2UB8kq7sV3+P4J38XEo7u7FfpYsmn0ukb6hvA6iXA=; b=4V7qm6emdVEzVgdss320ghXgZoHJu3QbJx7cV1+g2EWMDxAWq1mQVOdzGIMkQC9XdkFsrwtn3IEJIy66NtOauWk683bLr7E9lz1Ce3YHbnr7Q0NwTqVAeobCXQNueIo0+UUoFsOQ59CIje7PioqTFJoe0uIHXk7G7jsL7vtrMd0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by DB7PR03MB4522.eurprd03.prod.outlook.com (2603:10a6:10:1a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Fri, 22 Oct 2021 15:59:37 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::a9aa:f363:66e:fadf%6]) with mapi id 15.20.4608.018; Fri, 22 Oct 2021 15:59:37 +0000 From: Sean Anderson To: netdev@vger.kernel.org, Andrew Lunn , Heiner Kallweit Cc: Russell King , linux-kernel@vger.kernel.org, Jakub Kicinski , "David S . Miller" , Sean Anderson , Florian Fainelli , George McCollister , Kishon Vijay Abraham I , Mark Brown , Vivien Didelot , Vladimir Oltean Subject: [net-next PATCH v2 3/3] net: Convert more users of mdiobus_* to mdiodev_* Date: Fri, 22 Oct 2021 11:59:14 -0400 Message-Id: <20211022155914.3347672-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022155914.3347672-1-sean.anderson@seco.com> References: <20211022155914.3347672-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 Received: from plantagenet.inhand.com (50.195.82.171) by MN2PR01CA0036.prod.exchangelabs.com (2603:10b6:208:10c::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 15:59:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fe371e71-69ef-4f29-7502-08d99574f2fd X-MS-TrafficTypeDiagnostic: DB7PR03MB4522: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1TPenzVoHuZPhV2BkrSFtO9QD/wajUXf6QlzipgzLvK7q9RkVp35qTVhzfnfRyLL2BqAz/5Vhe7XVJJD/kmt6KvO8Dw3YrUcmjw5rsX/Y95mis1ByFQrNBSi7ZR3YSlV/OqaWtsiesFtG71naMzMOC5Feg6jwhZjXOX6ekbLtJ51Ud6iIuWJeovChhqIsGUHOCKDhisQ/PzKJptWrQXkA3ZMTDDNZmbLW3if5wesHo+15pVARzpij+NN5e4Ql3RdR9tILwKMAr6dZYEePFF/4OWZyQeDeb0O3xHUwH403BQZxti+YnF/gEhelzVTLdd8ZPBOuMIOCvT3XhSzaHKxeKiuGyTauESBRU7qgfYPgHIVzBQ2Q/NFmGOE7vwd0wOZq2QWLmQWbHmaK8afrCsJa09a3EByeh5oYFXfbbst5jUpCjCVsyjayf7W44BNiBYcVMqFI0JU5/+IM8SSynl3Tz0V/Z+j7iB7X15RcRoDakI5pcoxemAWAuI3bCocMD4ED1tJqrpKhNLddhR4qoIUvQWqNPorLWzKsprFQktSANt3Z+0XV27kXeBaghgPdVndzNaQnVUMq3fIDCeQ9kRfAID3kjsqG4V9Aubu30xBQxRd0cJmUG3CnVk8oCBFfrvpjY2M5lqLMjjEaXZ5ZghNo1XcyIcgA3o9yTjCyC1M4oYVzr7xzC9Go+WYUambk1cP/oLZwBndlRABbkGAVCmKHw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4523.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(8936002)(110136005)(2906002)(26005)(83380400001)(66946007)(6486002)(6506007)(54906003)(5660300002)(52116002)(86362001)(7416002)(186003)(508600001)(4326008)(66476007)(36756003)(8676002)(66556008)(6666004)(44832011)(2616005)(956004)(38100700002)(38350700002)(1076003)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r9JUmm+kioZzJD8pFutw+bA9h41Rf8jW5xb8FOiARdKgtkOTrFG9WGOhn+z3wgYyoGqr0bzoVcRGab2pq5e51hI0QlnEc+ex8kP+zzzGtVND/gYTx8x4TeuSXdOLpbbAxCpLE/nJr/AY3nNsZtwO4XAhP45QLTZRFDnm3L6wVeRv7XqfUIMb/NnAb6gAflhNi4Ql5E64GhpHiPC5Ba6i9gGRRy29omgmpUAB+Nn+Ow9IyiBjVP26sEVYjYm3DeY30T1igRvKJK9DBSvLWKfeE3c2R1ZUk2bgG7MpM1o7ZyV7LY7dATzLqKCw6KoGdMxs9/oWf/UD3yoGxZ0UR+ZS5FnffWecImw9iFiRLX+0WESsTtZOKF1YX4Z6nz3MSw+NMpn8EJVyHKiZTcNwXHwGZbTopcZZp/QLZsbVz3HXPnre0uRdWOTHERiXXmOJs9q+wd6YBTv/w0RzEvI0beVQ9VBeN6k2Qh3eb+Xgzav/a5EMbHo/4CGgKKWZ4ASLJsl3LnRQMny8/FDNWc+tTy5wC+rPFdJ2YvVoGn4egmZx48pFTY9/XzVu/ZDsFNHYWQTf7K+27x+uawtJjcgRj1VCadAZvE2dHM1PKZrzeghJJqg/PngnXGgoH1tSLdIGwe6e7z6eY4z0inbML5Gjn7KMUOuvaocAQJJCQmMwmrQKlqyqjzmDItqT3MoskhzETMKuMY9fZAb0MLmjnx8NW1JPa/j9uD52XCgvDRO0yWgCph3tN82uw9UYKFtgXGK+5FV2YV37Jmo0SAheVNeZBNrVAsYk2s+YqJ//abOuOY5wzWOC3BCvm9JeYOOgcldDU6zB0W6YLrf5y4GpQY8e9c3khcbXApCTI2Bx0Pg4Ak1/BWtRtQbZ1hQ5cXsVzikVwTs9850iR5CeWDEs/ySGA3DrX9N3DZGNoNyUexMjtjzdYY3O6JsEp/dlFz1OOYsHQauhDKRqBGclaIo9X65As6VP6tBBGmZAaKi5GrJTOgKJbNLwGOibV1ZoIEJpX7aNAJpMYTRTzzCv5Ao1KwoLYcrremhch6NNmnUG29pWS+NMqa2Dhaqk48iEkEcngdMdnXY4cGXHbOpXS1+83FVs7/V+k9UNtkE1LIF9FG4o3gtYt8/bXPHP5LxTspF9b3htvvxbHk0xcHPLn6ZfXu+aFMvjgtQ1/UvCPIBTlWV4vzj66zpdhS5QdZ8rNr6+DWhtFh7w5Ic3LOMPG7CBVh6uJ6ntlwGs35+26Ee+un9hrYXXBOOuOBsXEn7VsbKe3EQ3vUQVX0jdjHEfTmQQoPZXj5l+6zLQ5cYnYkxwJvd6wTWFXRtRjab0ecsNNr3hFrYUQADA X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe371e71-69ef-4f29-7502-08d99574f2fd X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 15:59:37.6276 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sean.anderson@seco.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB4522 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This converts users of mdiobus to mdiodev using the following semantic patch: @@ identifier mdiodev; expression regnum; @@ - mdiobus_read(mdiodev->bus, mdiodev->addr, regnum) + mdiodev_read(mdiodev, regnum) @@ identifier mdiodev; expression regnum, val; @@ - mdiobus_write(mdiodev->bus, mdiodev->addr, regnum, val) + mdiodev_write(mdiodev, regnum, val) Signed-off-by: Sean Anderson Reviewed-by: Florian Fainelli --- I am not too experienced with coccinelle, so pointers would be appreciated. In particular, is it possible to convert things like bus = mdiodev->bus; addr = mdiodev->addr; mdiobus_foo(bus, addr, ...); in a generic way? (no changes since v1) drivers/base/regmap/regmap-mdio.c | 6 +++--- drivers/net/dsa/xrs700x/xrs700x_mdio.c | 12 ++++++------ drivers/phy/broadcom/phy-bcm-ns-usb3.c | 2 +- drivers/phy/broadcom/phy-bcm-ns2-pcie.c | 6 ++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/base/regmap/regmap-mdio.c b/drivers/base/regmap/regmap-mdio.c index 6a20201299f5..f7293040a2b1 100644 --- a/drivers/base/regmap/regmap-mdio.c +++ b/drivers/base/regmap/regmap-mdio.c @@ -14,7 +14,7 @@ static int regmap_mdio_read(struct mdio_device *mdio_dev, u32 reg, unsigned int { int ret; - ret = mdiobus_read(mdio_dev->bus, mdio_dev->addr, reg); + ret = mdiodev_read(mdio_dev, reg); if (ret < 0) return ret; @@ -24,7 +24,7 @@ static int regmap_mdio_read(struct mdio_device *mdio_dev, u32 reg, unsigned int static int regmap_mdio_write(struct mdio_device *mdio_dev, u32 reg, unsigned int val) { - return mdiobus_write(mdio_dev->bus, mdio_dev->addr, reg, val); + return mdiodev_write(mdio_dev, reg, val); } static int regmap_mdio_c22_read(void *context, unsigned int reg, unsigned int *val) @@ -44,7 +44,7 @@ static int regmap_mdio_c22_write(void *context, unsigned int reg, unsigned int v if (unlikely(reg & ~REGNUM_C22_MASK)) return -ENXIO; - return mdiobus_write(mdio_dev->bus, mdio_dev->addr, reg, val); + return mdiodev_write(mdio_dev, reg, val); } static const struct regmap_bus regmap_mdio_c22_bus = { diff --git a/drivers/net/dsa/xrs700x/xrs700x_mdio.c b/drivers/net/dsa/xrs700x/xrs700x_mdio.c index d01cf1073d49..127a677d1f39 100644 --- a/drivers/net/dsa/xrs700x/xrs700x_mdio.c +++ b/drivers/net/dsa/xrs700x/xrs700x_mdio.c @@ -31,7 +31,7 @@ static int xrs700x_mdio_reg_read(void *context, unsigned int reg, uval = (u16)FIELD_GET(GENMASK(31, 16), reg); - ret = mdiobus_write(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBA1, uval); + ret = mdiodev_write(mdiodev, XRS_MDIO_IBA1, uval); if (ret < 0) { dev_err(dev, "xrs mdiobus_write returned %d\n", ret); return ret; @@ -39,13 +39,13 @@ static int xrs700x_mdio_reg_read(void *context, unsigned int reg, uval = (u16)((reg & GENMASK(15, 1)) | XRS_IB_READ); - ret = mdiobus_write(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBA0, uval); + ret = mdiodev_write(mdiodev, XRS_MDIO_IBA0, uval); if (ret < 0) { dev_err(dev, "xrs mdiobus_write returned %d\n", ret); return ret; } - ret = mdiobus_read(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBD); + ret = mdiodev_read(mdiodev, XRS_MDIO_IBD); if (ret < 0) { dev_err(dev, "xrs mdiobus_read returned %d\n", ret); return ret; @@ -64,7 +64,7 @@ static int xrs700x_mdio_reg_write(void *context, unsigned int reg, u16 uval; int ret; - ret = mdiobus_write(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBD, (u16)val); + ret = mdiodev_write(mdiodev, XRS_MDIO_IBD, (u16)val); if (ret < 0) { dev_err(dev, "xrs mdiobus_write returned %d\n", ret); return ret; @@ -72,7 +72,7 @@ static int xrs700x_mdio_reg_write(void *context, unsigned int reg, uval = (u16)FIELD_GET(GENMASK(31, 16), reg); - ret = mdiobus_write(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBA1, uval); + ret = mdiodev_write(mdiodev, XRS_MDIO_IBA1, uval); if (ret < 0) { dev_err(dev, "xrs mdiobus_write returned %d\n", ret); return ret; @@ -80,7 +80,7 @@ static int xrs700x_mdio_reg_write(void *context, unsigned int reg, uval = (u16)((reg & GENMASK(15, 1)) | XRS_IB_WRITE); - ret = mdiobus_write(mdiodev->bus, mdiodev->addr, XRS_MDIO_IBA0, uval); + ret = mdiodev_write(mdiodev, XRS_MDIO_IBA0, uval); if (ret < 0) { dev_err(dev, "xrs mdiobus_write returned %d\n", ret); return ret; diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb3.c b/drivers/phy/broadcom/phy-bcm-ns-usb3.c index b1adaecc26f8..bbfad209c890 100644 --- a/drivers/phy/broadcom/phy-bcm-ns-usb3.c +++ b/drivers/phy/broadcom/phy-bcm-ns-usb3.c @@ -183,7 +183,7 @@ static int bcm_ns_usb3_mdio_phy_write(struct bcm_ns_usb3 *usb3, u16 reg, { struct mdio_device *mdiodev = usb3->mdiodev; - return mdiobus_write(mdiodev->bus, mdiodev->addr, reg, value); + return mdiodev_write(mdiodev, reg, value); } static int bcm_ns_usb3_mdio_probe(struct mdio_device *mdiodev) diff --git a/drivers/phy/broadcom/phy-bcm-ns2-pcie.c b/drivers/phy/broadcom/phy-bcm-ns2-pcie.c index 4c7d11d2b378..9e7434a0d3e0 100644 --- a/drivers/phy/broadcom/phy-bcm-ns2-pcie.c +++ b/drivers/phy/broadcom/phy-bcm-ns2-pcie.c @@ -29,14 +29,12 @@ static int ns2_pci_phy_init(struct phy *p) int rc; /* select the AFE 100MHz block page */ - rc = mdiobus_write(mdiodev->bus, mdiodev->addr, - BLK_ADDR_REG_OFFSET, PLL_AFE1_100MHZ_BLK); + rc = mdiodev_write(mdiodev, BLK_ADDR_REG_OFFSET, PLL_AFE1_100MHZ_BLK); if (rc) goto err; /* set the 100 MHz reference clock amplitude to 2.05 v */ - rc = mdiobus_write(mdiodev->bus, mdiodev->addr, - PLL_CLK_AMP_OFFSET, PLL_CLK_AMP_2P05V); + rc = mdiodev_write(mdiodev, PLL_CLK_AMP_OFFSET, PLL_CLK_AMP_2P05V); if (rc) goto err;