From patchwork Mon Oct 4 19:15:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12534577 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 6B1FDC433F5 for ; Mon, 4 Oct 2021 19:16:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4593E614C8 for ; Mon, 4 Oct 2021 19:16:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238970AbhJDTSa (ORCPT ); Mon, 4 Oct 2021 15:18:30 -0400 Received: from mail-am6eur05on2057.outbound.protection.outlook.com ([40.107.22.57]:12353 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233226AbhJDTSN (ORCPT ); Mon, 4 Oct 2021 15:18:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gw3rzR+qH/UGaQStnSdRRtVy0YtVcn7kyRCrAEVdaH0gYWbeA5aObiRfG/4WOSbiKgebr+n85H4akX6KNbrzNC7hzWSN6qHmDxKnpktp8vz6I8d8dgrU/JUyjNO2EulsX3t99jN7czydUOZkDJDB3i/BLzhuHorgIrCn3j0hfIfk0rUTKVpDiT3aCC1Ajsd/1q6vLWj5WFnguaIXwGEWfL5Evu2uIKZ+Wx6NyX6lbrWYvZua00LG93WAqnRbWkxJHUarJyJX+BS0f/boi51thcoUhAIFVHjwUTJLLoAEtADP9LmrjeYvbV3d4x7AtaOCU//pAeAFxtzscReFFkFEaA== 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=iQpI/SKiZJcryo5tqQ5tICaSSYyykdGzHbcj4S8x5MU=; b=UDliIK4DEmYZ3DO/RoY7cxY1F61gS+JNuePcSUIKcPjntNMPDRFaGgfOJ1jxvPR8pJ7vDredp5AeUe2rVb7d9RoboIBCIkeLQe7GL30Jp7ZXyRlAECJtokAQxGEwT4R9gL0H9Gl9cetoRZbqVA2a/xpE9yQ7HGd8rGcMpQGP2h8xEoTDYD/YHwI8IkolcTWy+Cz6wgujRM/PeOegUVNhHubJKjOGcxTtREx6yBfJL9Fto2iylyQMkhtqUn+x6g3qRiovdRfFv56FWvxsnvod6m55GCMbn7u/G+Al/XPitpCCuroYcoVZ0w+dogu2HWFbQCRfnKjE+qx1y/i+nl64Jw== 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=iQpI/SKiZJcryo5tqQ5tICaSSYyykdGzHbcj4S8x5MU=; b=R34QqN+okyh+ZcRdXRYOi8IVNpeZTgr+VjD4703UKPebcerfZjRC3+FEqUJdbxEYnZkjbz9SGDfJijuk3vLoejjqrem2jtIWF07WnyoYEJEi0MtRuc4R1o85pHXKhnOxquULyVoE3x9TIfg6YH4B4YzzGh+hUx+lf9krf+tYawE= 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 DB6PR0301MB2183.eurprd03.prod.outlook.com (2603:10a6:4:47::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Mon, 4 Oct 2021 19:16:08 +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.4566.022; Mon, 4 Oct 2021 19:16:08 +0000 From: Sean Anderson To: netdev@vger.kernel.org, "David S . Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , Sean Anderson Subject: [RFC net-next PATCH 13/16] net: phy: Export get_phy_c22_id Date: Mon, 4 Oct 2021 15:15:24 -0400 Message-Id: <20211004191527.1610759-14-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211004191527.1610759-1-sean.anderson@seco.com> References: <20211004191527.1610759-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR08CA0023.namprd08.prod.outlook.com (2603:10b6:208:239::28) 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 MN2PR08CA0023.namprd08.prod.outlook.com (2603:10b6:208:239::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.17 via Frontend Transport; Mon, 4 Oct 2021 19:16:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d3f5270-1169-4c60-f3ff-08d9876b6b4d X-MS-TrafficTypeDiagnostic: DB6PR0301MB2183: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:446; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: csXIrHgTdbS29XW9ld/JmT/W1yZ5QTogyMbAxe5/FqmO/qQVNO/fM8FkJvHr7iGPE+CIvRxOaaVej3kKkVQVXei4sqisV4GaxT1pwh46bEg7fDqmk/3+V8GEniBrgVhn1dB3HgJVBr7BpB0Znf6gOaM8Hk23AHwodrs2kkfDCIzCApvuX9ddmSOW7y7K+p3NHMEVd1AqlJ93fu3ZEBoK1FO4S8a41QYOHPNg3aDNhl5r20rRbuwGHSj4mkWambwsfbgSwfjSOaQN9bB9dakGYmhut7h11dFusMfRt5EghhQsZiZAWWIfY1o8JEiSicb1D9AER/xePTDsVjuECP3X+W1RfIwqvRGHCHeNiNnCRx5g6AYaZeMDNuUTlWBx4ct0fuJyHiWMD+so3AtP7UcB66opZvaAX0PFfP+OyFNwVPvS9hsmWv+V3b84l92Cr3WoENQV8t2mwNJ5X9Itm+yn0Xhtv8orBU7rBoPod+opLC+cFmfU+YCyArm8zWV4Wkk90CIgAuB73g/D2ozzi/h67y7a4SNGVKGzn2wnR9qtILTaiQqNzLlqbAAXNqCk7L6x/RXUplJBeSXUhQRsjeYKYTiR13dFAgCPGG3ZzDJ9nud9OQo6j/l2Y06HgH0ClXjkkW85v2B4oIa2y5izxv56YZ6F0bryz7xxHetBydCn9O6BvJZeoCcb1Bi/YI7iNsddYstUoOPFChYg5IjNrFch6g== 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)(508600001)(186003)(83380400001)(2906002)(54906003)(5660300002)(1076003)(52116002)(26005)(66946007)(66476007)(66556008)(44832011)(8936002)(110136005)(6506007)(2616005)(107886003)(316002)(6486002)(6666004)(36756003)(8676002)(4326008)(956004)(38350700002)(6512007)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-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x7dROfmZYOhw+LuXgZ4w9kOC4wrtYMgDyXe0nBgBa1NHcigfiB2Zv3gcijniv9LpEudDemb+7/j0NIXBNk1HJJGppr/ENAjYuZpZEFTBVUVVbJ4Jf+EQpKIj1nJl6PF68XBATc2djUuP809runl+5Y46uc2cAnx2sVsrTdzdEQA24lqRHSklLmlxezlGmGSQv24qZzqpbl7zyh8BkV7ndyDnFPWE+x0LOrAADB1hRHSvPXL1cFe1z6AnIKcj+FX4y/8DKVvzm9j+DnzzskKPsvc5eMD1n X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d3f5270-1169-4c60-f3ff-08d9876b6b4d X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 19:16:08.4261 (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: kb+AUXvTe3Hi7wgu+p5M6E60+Go4CBxjlTGQdXThK7EbZfOEfjllhBfl4C1lHnmQHfEr9B0aomd41LKXQTGijw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2183 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC This function is useful when probing MDIO devices which present a phy-like interface despite not using the Linux ethernet phy subsystem. Signed-off-by: Sean Anderson --- drivers/net/phy/phy_device.c | 3 ++- include/linux/phy.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index ba5ad86ec826..c75b189f1a3e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -805,7 +805,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr, * valid, %-EIO on bus access error, or %-ENODEV if no device responds * or invalid ID. */ -static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) +int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) { int phy_reg; @@ -833,6 +833,7 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) return 0; } +EXPORT_SYMBOL_GPL(get_phy_c22_id); /* Extract the phy ID from the compatible string of the form * ethernet-phy-idAAAA.BBBB. diff --git a/include/linux/phy.h b/include/linux/phy.h index 736e1d1a47c4..206049c0f587 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1381,6 +1381,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, bool is_c45, struct phy_c45_device_ids *c45_ids); #if IS_ENABLED(CONFIG_PHYLIB) +int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id); int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id); struct mdio_device *fwnode_mdio_find_device(struct fwnode_handle *fwnode); struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode);