Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4133754pxb; Mon, 8 Feb 2021 08:42:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzboAU0a2vDewKMFwaajcAyqzu9xJKuPiEmExFA9EJdCKTOqyeS97C4ZuyC3GTsp/uiCAdZ X-Received: by 2002:a05:6402:2053:: with SMTP id bc19mr17537738edb.230.1612802549989; Mon, 08 Feb 2021 08:42:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612802549; cv=pass; d=google.com; s=arc-20160816; b=pm0pUPtvVsUe0C8jLlJtD5j2Ugc2f9jNjMB8VIjnWIFL2II0ozaOGpJkokBuYWm5u0 GQkaRCu7JDW3Q+zgvPnE1gH4Xx8NI2OKLi89lQoBrMDPv584lvN/X70gwOWsQnmBu9Xn 8Y6Pf4P5TxBo1crmV1C3vbXBgSMKoXVnciobErJ9cobJ5oN+GlIEaR3E1Pyq2o3hhi78 BuOdR2l8QizdCWA4dw+lWxgTiEJom9dRg93U8xqU7nN1ajpOfih1lR88fWqr2/Jh5E84 5/HM41KwcFrMPENjPcfd6qbmu34zsQMCfDuE9/VoA59YjAHf+GLLODm8OCQd+2X5Vewi rT8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Mr0qwQO9Qn/2Fvqmt6x3cOBdgVvKHvDjHxHWCZw6rXU=; b=uxY/xmVSzTPDwxCPjOyawQ9+7BPZkPanW9XqYj005xoNoSg3IN+025W5xfS5LFRLAJ BeV1eDWdOOn1dHS3/3jPpz423gZYk1K6DXFnSnjMzouVvC7bF2RBrQlDpAnJ4+NQRrY2 AQSI+QARHFWCFGtBMwWjL/2gvuCxcdB4bGtGG54eU3DhRsr6yRZ62pLipYOaLRGVx2N+ ENg3aNK3U9kozC2JFuaWzRMzV4ARyxPaTSs+B7RFH5IIIoLqSap16SywyNVucJ8Zeke2 Z7J/J8yDfAe0IROgaEXa5bRrJ0uCb72Fu6Y7/yzgL660XP17Lsh5rLuDDX+LxFpVHVs8 LcNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JPk0fqbX; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w7si12547373edd.560.2021.02.08.08.42.05; Mon, 08 Feb 2021 08:42:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JPk0fqbX; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233619AbhBHQld (ORCPT + 99 others); Mon, 8 Feb 2021 11:41:33 -0500 Received: from mail-eopbgr70057.outbound.protection.outlook.com ([40.107.7.57]:12679 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233539AbhBHPPX (ORCPT ); Mon, 8 Feb 2021 10:15:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGR8i2qnpYBYsBpwlhgEqiM8BMdNJG9Odlil5YYq8JqQaZIGVj8sE+O8dcTMfCyZ3dRKTtvSzY6FQBL4mmKZDL0uGcwC1R2UDT6qNyweoDSPGStxQ2oo3ZcJFfOpjyEl0M4JCm7K4RL9+ggZsqJNROx9gnFsaZYCgQmr7pBQGDuchR+xUUxTn5DNIa0ONgEid8i+KgZIPHYHQNeUhassyFbo6fQjbPtxNz1fCBS7kBqYaFcQJRgv3mzMTwsmKmkIDTv3nJUbZsOslw2UcCu4LW/1LR//2DcReCGh2mYpN4SQlx7psrwqsC+EyskuJnuSUhduhCjGcMl22V3ISwhyGQ== 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=Mr0qwQO9Qn/2Fvqmt6x3cOBdgVvKHvDjHxHWCZw6rXU=; b=TBXa2L2xrmQeas0LZf0mEJndKbEQjVl6jQwT0iRbrUUwVl2DvkbY7LqEhF7KmE4JHRghhTWR233crIjsNQwYo6eMG2fQUR/qY2x/FlhM9ceYBsSVoheLcfnfu+h2URKxkEGvBldbZ1DsFoRTabL16m1h9IWrb3EY2E211Ea+0PyZUDdUf3Pr5kGMzEAvKd95Q0ueHVxaeESFGsPlxlWiQ/patELNIPV4Pyq5znVBd2o/ddSgGTrlMGX15jp3NTFxCrhCmIPh0gLgpOCAXNW9CTvXPu11xGBysS0WArp2fAtrqIFY4aXgORHML6CoX3fnqRjGClR/EncfHhzKNFFMZA== 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=Mr0qwQO9Qn/2Fvqmt6x3cOBdgVvKHvDjHxHWCZw6rXU=; b=JPk0fqbXla8HdzjnuLOQW2NmSmHIRWqnhmYnAMw87VYX86YKSBVreoJwE5usCzP5PFDXwQDHR3M30DO9cX90AvUXSgXlb8m620DeZn+f/JrBj5W+esTKM31q02KCwtEnLrdddMD/a1pplTzHRyMnJXLonsmjD2ws2Xa3bmSnzoo= 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 AM0PR04MB4772.eurprd04.prod.outlook.com (2603:10a6:208:c2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.30; Mon, 8 Feb 2021 15:13:59 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::e90e:b1d6:18a2:2d42]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::e90e:b1d6:18a2:2d42%6]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 15:13:59 +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 , Saravana Kannan , Randy Dunlap Cc: Laurentiu Tudor , linux-kernel@vger.kernel.org, linux.cj@gmail.com, Diana Madalina Craciun , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Calvin Johnson , "David S. Miller" , Heiner Kallweit , Jakub Kicinski Subject: [net-next PATCH v5 06/15] of: mdio: Refactor of_get_phy_id() Date: Mon, 8 Feb 2021 20:42:35 +0530 Message-Id: <20210208151244.16338-7-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210208151244.16338-1-calvin.johnson@oss.nxp.com> References: <20210208151244.16338-1-calvin.johnson@oss.nxp.com> Content-Type: text/plain X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR04CA0176.apcprd04.prod.outlook.com (2603:1096:4:14::14) 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 SG2PR04CA0176.apcprd04.prod.outlook.com (2603:1096:4:14::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 15:13:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9a041cb5-baf2-4ab5-3cc1-08d8cc4428f6 X-MS-TrafficTypeDiagnostic: AM0PR04MB4772: 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: yWx8N6o0QkVFm6ajY5+ycsOzNjT9gSgXGv0hVdJ50wr6AwmrmESlnUYc9XCT0kf0WWtdQnMABs1eFAlunZ/W/wlklleRtFOCB2wOV1esJDPi5XRZ4PVhbWrFy6EJYJ2e/KuDjcZcz7xlEZ1ClqD39V6a0ouYM3GkN5xnwa4Ho65NlLKYuttgVgQo653weazZ9s7NegtV4uULk0xg3wQ1Wpi96BTwrjrrLV1hB9UkSBB9oQF7v3pzSCm9aTUexcxP+Qfx9u8R+RuHFPq2BlwHwwyDm1FkcKDnJBnaO9iJ1Ys8XLRg+a6cNP1Ey+VEVI5jy8bYcmvvruWrbshHcPUSJ7biqmb60KfrH42lipr885TU74q8orDD0n3HRStZqimyB0NNvaBmHbWjAH3qEy+SXS5XCWqiW+ihKwjXnX4099RcteLiirhw2CjJ1yJthG9jiti0wYzJMg6ulXHNeGAUdM5UBwSljQs3eNvwIN4nPL+EBaw8NNQGpLAJZYBdnxOyqz8tBbrzvoEzELsbF/m+DxdWhHz0M65/NoPozxOnb+sD6sfzMv19E2Pfmt+ST5JECqTN83fHLftuRUzyWXQjpA== 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)(136003)(396003)(366004)(346002)(39860400002)(376002)(86362001)(8936002)(6486002)(7416002)(16526019)(83380400001)(2906002)(6506007)(478600001)(8676002)(26005)(52116002)(44832011)(2616005)(55236004)(66556008)(66476007)(5660300002)(66946007)(1006002)(316002)(110136005)(6666004)(1076003)(921005)(956004)(6512007)(4326008)(186003)(54906003)(110426009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?yFtUSHz9l/T9Z4LJRVl/umaKO9XsRqcM20ivkQTUsIFWoxAUR7SMnCDoH10W?= =?us-ascii?Q?+1QiPQncofV3T088oJYJVr3I/7roHzt/yHW+S4i5C8ppQipMfZsVTwY/YmaL?= =?us-ascii?Q?+zi3vHgnMTzep257oDjvL3lrX+vXgpFZEQpio6rg1DpIfydkwYUfMCG2Fh8/?= =?us-ascii?Q?V3zPbczZzAmNvzbiJHy8sbQz/ReB+fBPXei8M4LibbSNAiy0Izji2McpvIty?= =?us-ascii?Q?qdQuroYDLLMcha+bKek6MQhRBqPYR8YtuH8JdyzIG4h20+oEPmUSiqIN0E+a?= =?us-ascii?Q?35QjwncYQE/2EfHaoSFCPI/srhStqwx+Y1hQFgUPnVMoX7jyd0iEIGnOrotd?= =?us-ascii?Q?Q4f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a?= =?us-ascii?Q?R4waj4CX+DqqYWBlX12bOlJtuhyJlHauVazYPzoZIf0A7KVAAX3+pwEYKWl+?= =?us-ascii?Q?4zVRDRweUrtNuTGycBY5p7vt?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a041cb5-baf2-4ab5-3cc1-08d8cc4428f6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 15:13:59.3761 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: xRckg273teGyb1yPMg0oUxHekXv2hFjwoB8HVwhzTxifhlUGGL6S4VgDX6h2Nm9YPHBBzovcTr8HzDBjkQTTMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4772 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 v5: None Changes in v4: None 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) -- 2.17.1