From patchwork Tue Jan 12 13:40:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Johnson X-Patchwork-Id: 12013519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2470C433E0 for ; Tue, 12 Jan 2021 13:44:51 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E4CEF22228 for ; Tue, 12 Jan 2021 13:44:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4CEF22228 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hWIJtFDqszJ72kbTRF/9C6RGmRQm7Pj4ZmxmTTtzUgg=; b=WPFLATP/z+c1JyKIMLmD1/Jom +qxCDyVeiRJrCcEdw1Ss3zsJwCK+n8y0zAIcc57LJA2rg9zF9+A5XvTuMrtQENLjn9nbeO9DL93EV NKg7/VA2496m2x//09MnwF+VH56DMzHfazNSkYV/zmmjsKwiizANrf46/S0vbB0urgPwNYnzxKObz tKDUGSi8feWI7mobjUkNdjmw+WNEkieW0CjZ3E+hM+uAdciXql69hpAO98/aWZkioMI/CtAlBRH9h vm2OFeh8d3Af9g9epVIzjteTZlNlkJSpPzTLKIUFb9w/d+DzzX85EFMljyIPLMoiGN3S739ogBP8A oWEITSjjA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzJwb-0000Hn-JF; Tue, 12 Jan 2021 13:42:45 +0000 Received: from mail-eopbgr80071.outbound.protection.outlook.com ([40.107.8.71] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzJw8-00005E-8U for linux-arm-kernel@lists.infradead.org; Tue, 12 Jan 2021 13:42:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itGMdzPABJmeepj2KDB/D/sulxbke2qOn43m3Yol7YRIismPljrBOkgnHcrLCE8t+Z7aJ9WY7r1d6xZ2P6hHoB3TAS7AXRB5z+mKAYIbjMWoMzlLqnxB7K+o8QJ1W/Q+OfIioWbSa2QDT8BQPW9ibhTgBwO+r+LjkvKf05G8PrSLlvOBKzBNo6HlYtYeX/EKIrsDfmrOu8AlOaiou01NiNxDHk72aZiiczmRS8n0tNEX0QnoDeDmxedkEuFwcvqwRk00cwRknVLyHR2hZy+iz/6LSUCdq/ofAJhYgubE88FTQ7sMoLKaebhV3PX3V5PvSykpruReV3FcBCCaVGBPbg== 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-SenderADCheck; bh=A/GZYEKwN2XEO7X3Ja85i44fA9G+dbp4sg/xUjpRGgw=; b=L+Fmm60Icec2l9/cxcaLs7/5Sx3COLJjjrYh9IwLNTRYyRpuT+lKQP3eJUrQO/6MXZmeJ/Fd44TwTANzAgh0rGflqoH1a96R4JYFlfBkbJUnp0DFvBKwaIPidYqcFLU4aZYG4q/ReePjkL/WcEQx42a4PKGKMZ4dkK5byRum3bE1mYNUHH5VEaKNbhdNxPS3pYGMfVfzNfqBBl0hHyP0C3uxXGqkMfdXlWlR+JtTB6B7yJ0tbniNWw9qlcXD9MYWw0e8VZlB34+VvHovIIBSgNQkHh0P7ox1PcWRtswJsV8A0wZ0c/l0PCu0uLcCdRXPAZ1pVaZdqc36jyPqdXCO+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A/GZYEKwN2XEO7X3Ja85i44fA9G+dbp4sg/xUjpRGgw=; b=mYMsyIIRVl/12sAilqd5ozTyE3t/5CrLeN+E4IqJLWlVZGLTlA0BrMbFJEune9WV/zOAdjRdhT8/Wueq9AWR3GPfHT8dr2pV/I37bvWd2LM4pkkDHdDX1JMO8WO/KdfPAH6xelQtRazqkQZbv4xDTXqxB5x4YtQv/htWZsxhaOs= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6964.eurprd04.prod.outlook.com (2603:10a6:208:18a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Tue, 12 Jan 2021 13:42:13 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd%5]) with mapi id 15.20.3742.012; Tue, 12 Jan 2021 13:42:13 +0000 From: Calvin Johnson To: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon Subject: [net-next PATCH v3 06/15] of: mdio: Refactor of_get_phy_id() Date: Tue, 12 Jan 2021 19:10:45 +0530 Message-Id: <20210112134054.342-7-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210112134054.342-1-calvin.johnson@oss.nxp.com> References: <20210112134054.342-1-calvin.johnson@oss.nxp.com> X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR02CA0047.apcprd02.prod.outlook.com (2603:1096:3:18::35) To AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03152.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0047.apcprd02.prod.outlook.com (2603:1096:3:18::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Tue, 12 Jan 2021 13:42:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b0435022-5da2-4071-054b-08d8b6ffde3a X-MS-TrafficTypeDiagnostic: AM0PR04MB6964: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /I1Zmm0yazXPo5q11rvLOyxaWR6ABfmoIEExhQ6HdBtCQ7GOsnuAS+ZoigOfIT8hDqPQw9WOI+HSEy07jLJdDWHbwAktZV547HflT/XdKtDYLUtJYlTkfmlp5rLnBEgnXC9hgvUKanjbJOCqdFNJ4CoaiBF2b+PHb3B0AjaeHLVj1AlRHaejcXZs8Yzzi4wKw42sB6KIjhOFw5zVgKH+ywG0MWi95p7cxMH8KXV5BpL1wwbGrOJ9TxJLIQc7xP2lMBrpQCTz5YaQgWtO34EMpW66cwCWN0C+KvaoMAfYiEV2OMWrixGN68/aArLiVMt5WprysvD+BWhqIzJelxC+G3olZiBCIocmH/c6OAUudDo/f+oQuJvog1leAErL6QSm8KUJT9feeQSpCRWIBDJPVeQ92XGOkUfHEiZdubfmpBVr1yhZEzqUAykY7SKtLle9ycYE+2X143z9mdbm29NclQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB5636.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(346002)(376002)(136003)(396003)(366004)(1076003)(6512007)(7416002)(1006002)(5660300002)(52116002)(6666004)(8936002)(6506007)(16526019)(186003)(26005)(55236004)(66476007)(83380400001)(921005)(478600001)(66946007)(66556008)(6486002)(8676002)(86362001)(44832011)(2906002)(110136005)(2616005)(4326008)(956004)(54906003)(316002)(110426009); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VOFXFs3zh19u6dH3KiFJ/r5J0++9RGmsDNt58+qBbMCu3KYjLOKuOYlotF54MXPCApOQiJSQ7H8dMvhh/eUTVbbPSbRc9gihDi2jEZgsz5bp/VuD6T+QwIiiyD52AGCacTbVgY7tTUUVWuuFfZlFgucJOsU9tvj6WOkIabDoIQA23FLg+HqwXzSmKY4cHQ48iCus53vNfbTG5Qz8ebpGj7edY4DIklmjKeADrs8RfMV8PWCPATY2TSTO2NcG2Z9P6BOuFO31HlHUCZijmdxidRDl2QdGeOlenJWHtPeWO9hHOyfSUyufuVerE44Y9AZuy1NWKEh9Xdl5siXYwdklwd15PKR0Fp7HQeDM+AqSXIjkXjBi6mRZNEtRXdR1/xwsbAOI57SLXlPYGPhJdN/3zXN75Jdnl/XTnhTtKIR8zDNQGH+prkxSCyzCOpdeu1QTJlnK7K/Sg79qrNSEckqd6gkERKAj1KmbZCuUQZV35zz9wCLMBcM9nexEULXz6MMiOh6Nlo8pBgJi5/o1R0Fn7OLRUBnIMLvcLSB9TJP6Z2Lrt9CLw8iZn8bYi/gyMkjsIYEjFIHsR/LA8F//hgxSK93OycvlQLBUgoF5HZl1B+IpcYPJQpJ8d4MH1sVwanZETM+ykYwmzxgdmc8V9zRJn05Z3nD0k+/hhOppxXigmGz1dJ6lTF/KCVjow1lrMhRPnBArVTJRAFpEkXK+80CgW51wfSH8QYew4AcIwP+BUvGLIYOym7QCkJTKI+t4hYOiZCSiC5SjrzxjE/TcFxVYlslG4W+r3CnEIr2zlSf8OET/uoQx/OODnPzylc+73dcWue7eoZxCjgIPg7xE13K9NZAQdM5SPoADJgkHzTUYQIOHLkOpzWcLfoTRlZIK/CYMA9gEJiV6iPBrnR0X7ikORWaSj8Dz1f7vWQ/Tk89H64/ibyb3Ftg1g8TUY6GYMChvbu4i8FQfpTzQ/rtY9nyz7OydCYz5s4BqZfDT0XrLFmqUcATxpCNloVYNzdf8ujDT X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2021 13:42:13.3155 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: b0435022-5da2-4071-054b-08d8b6ffde3a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b4JjjWawT0yFrAgsoy78B0Qgj2dTtpHzKi69NhV0RW8bIPmF38xWZq/bnbBqqtp26IGSuxhPjWKLlpAhHqueRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6964 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210112_084216_750831_2EE6C123 X-CRM114-Status: GOOD ( 14.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Calvin Johnson , Diana Madalina Craciun , linux-acpi@vger.kernel.org, linux.cj@gmail.com, Jakub Kicinski , Heiner Kallweit , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With the introduction of fwnode_get_phy_id(), refactor of_get_phy_id() to use fwnode equivalent. Signed-off-by: Calvin Johnson --- Changes in v3: None Changes in v2: None drivers/net/mdio/of_mdio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c index 94ec421dd91b..d4cc293358f7 100644 --- a/drivers/net/mdio/of_mdio.c +++ b/drivers/net/mdio/of_mdio.c @@ -29,17 +29,7 @@ MODULE_LICENSE("GPL"); * ethernet-phy-idAAAA.BBBB */ static int of_get_phy_id(struct device_node *device, u32 *phy_id) { - struct property *prop; - const char *cp; - unsigned int upper, lower; - - of_property_for_each_string(device, "compatible", prop, cp) { - if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { - *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); - return 0; - } - } - return -EINVAL; + return fwnode_get_phy_id(of_fwnode_handle(device), phy_id); } static struct mii_timestamper *of_find_mii_timestamper(struct device_node *node)