Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp105127pxf; Wed, 10 Mar 2021 22:23:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJza7lCXCbS3sOWuDslwIau4jm+rgXbfxWeDao8lmGZgmZLg9TKvWIyB+P9/fG24KF2wCjM5 X-Received: by 2002:a17:906:32da:: with SMTP id k26mr1500674ejk.483.1615443804450; Wed, 10 Mar 2021 22:23:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615443804; cv=pass; d=google.com; s=arc-20160816; b=Q6ebRZ26pRmgGAKfCprFeLtO2yIm0hCfw5AKLT+tt+OTDemRLMnGL9iMnzhhQP/lPS 8Z8WLcXH90zUGpifOFN+ZBtrkxSO0GiKgHf6sZUhmg8LTnRXxMPLwkRiCkaD6Ck8Uxiu TdHE0cRtgVUlpwo7nmI5SByg6gvfoN6Fg+Dfsrfr4TUUFJLyEEFhGRag2/c4bnpiV+Am FMdooZ7TnBjOOqysaQhb75SKt6TzbGz4Gi9Qq/m4WPz24IaGuZi9a5G/0fmfsVWBK97Z SFVdYWOBut/UUvP52lFI5ZDDTOYPlMH8UZzLNuNwhH9g1lYpj3sceIadyqwV7b+oPxkP 1KSQ== 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=W0KWhdwt0sthDqdeYS6b4CVL/hdN8E9qrYOFcNUqUXI=; b=f0GcoJsIl4mr3beSdgo0NGk40A+cf5p7pRYox/NYc2ChtxixukKsHy2fkhyqRXXkVk C4Z1DUEiWjJhRgIqiATvHgDlzQJUN9BQ2hGpp+BwylKdhxi7jmuRUwMNyM0dEqghhsLL R0Nf9O8CHJbN4EnQwiTF8urHcvvvZ1zOvhmhKGOQK/vrHRpAvftJVYkrMDMQ4PT+jMDR Sw5Ube2MUCzH/sTIkXlRZWM9VQCY2UjSAWToN0lnS3RqMM093mzYEAo4+Xex2K60M7GB SdsszKkBrD3/KoD5EVFQ0foGsNxSaFivp3EP9pXI8Wb4e/L9snLcQDwLDlfJkKCkqQGy gtww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FVEkRcHo; 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 k7si1079214ejs.165.2021.03.10.22.23.02; Wed, 10 Mar 2021 22:23:24 -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=FVEkRcHo; 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 S230301AbhCKGWH (ORCPT + 99 others); Thu, 11 Mar 2021 01:22:07 -0500 Received: from mail-eopbgr20058.outbound.protection.outlook.com ([40.107.2.58]:22014 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230456AbhCKGVk (ORCPT ); Thu, 11 Mar 2021 01:21:40 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d0HM++Priq53qKfKx5egXjGPwuAW3H6ZFfcjkiZwTZMS39Esue26sF09WYZqcFr0htnLmfojI2+hK/gsvIq77oF1kAGjU0jq0ZDHw+6MOXbyjRK75joWFARNR2wtAZsLScxjY3QxEJ0AvbymGtTyIHsrdD5IuktYCcj7qMVP4VIax5/RCOwsjB6Rpfzodha6OAJrgX2+fw6KMit1mT6Z0k21UQJ2whgv8kugPEoz891ozdUn3JMimFay4cchAVO/Gh7DLcMkp4DIeL9ksGksL035FGbuURPY/eyKxVARKYXEVh8b//7cFA+CljPkDsUZoEY1YEV6gHDv1WmtZTO3IA== 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=W0KWhdwt0sthDqdeYS6b4CVL/hdN8E9qrYOFcNUqUXI=; b=iPhF/bCKlAQIbmo5PJbIkHYzzHknDO1lVkNKjZrX7yYP9OMjKz3OIIBXj9WVmWFJuQdGsB4c/OgBmtv1mz0N8FztbtD7pRLq81tn1esyjuQiAHFCtLpOSVE9KK515J3ysU09eF2Ob7KVblkkp52CkhlERthbz777TwtlazPBoeoQjjUrhaaQzO7TNx2s4SyGsYuyJ6R7NePO/Qt5QCv/WB/lKEHp3mVrHgw0sMfcY+mkjc3ibExcq2sl3cgZD56AC/skT8zXI6SaDOcmf0y/8AiIbQRZpOiKPoss58Pj+3pO9L3IuTSf8dqgxSIUJr9wRTO8SMChtA9QF3+65moAQg== 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=W0KWhdwt0sthDqdeYS6b4CVL/hdN8E9qrYOFcNUqUXI=; b=FVEkRcHoCqTkTgX6GQOc6f0s6ygU0k9ZVQowNHjraa4OCGTb8u8vVeYre6+0nTZ0J1Z5tUKbFvsrzQkDSMesFS2b+NcGTcFMnOW7Jrp0kQEwTKRD55sRvh2nTdCV6hnUZ3Cxklrnm5CPPocCqgh+8cnu13Ex4M+B/Z5inwtj9f4= 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 AM0PR04MB6611.eurprd04.prod.outlook.com (2603:10a6:208:176::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Thu, 11 Mar 2021 06:21:37 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::1cd:7101:5570:cd79]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::1cd:7101:5570:cd79%7]) with mapi id 15.20.3912.027; Thu, 11 Mar 2021 06:21:37 +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: linux-arm-kernel@lists.infradead.org, Diana Madalina Craciun , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux.cj@gmail.com, netdev@vger.kernel.org, Laurentiu Tudor , Calvin Johnson , "David S. Miller" , Heiner Kallweit , Jakub Kicinski Subject: [net-next PATCH v7 06/16] of: mdio: Refactor of_get_phy_id() Date: Thu, 11 Mar 2021 11:50:01 +0530 Message-Id: <20210311062011.8054-7-calvin.johnson@oss.nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> References: <20210311062011.8054-1-calvin.johnson@oss.nxp.com> Content-Type: text/plain X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: HKAPR03CA0026.apcprd03.prod.outlook.com (2603:1096:203:c9::13) 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 HKAPR03CA0026.apcprd03.prod.outlook.com (2603:1096:203:c9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.9 via Frontend Transport; Thu, 11 Mar 2021 06:21:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ee156e07-81ec-4e28-f7e9-08d8e455eca2 X-MS-TrafficTypeDiagnostic: AM0PR04MB6611: 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: rqUskRW6r+LgN3wsSyCuBrK4SQSdAP3pZQlMXdTWfX1V9us4b8dFBtYKaIHvAauTMpqSOhaMpN8DBNW+rOKJmWrk/1weyTjeId8SEc1ozJ3zWIN2L/3JpESiYak6oNkC23V27wSXvB3XpmSg00yssssu0HjvQEusuJz2PAqduypTTYZ3kREgzKA7dz5H1Oh4qPU+JcTzmN8pGv801+HqpEXmXEeYjpzEY6q7jIVbSkqw6a+IQKP/0Nkm7r0WRTfL1OTLbqqkOp66xLdaul4VNNM4bxM39DOoGMyzwBzkMyDFpmaxRiqZqGAIqZ+HNNy2XQrH8Otc7O6TBfZrU8cQ4+0K48VH0XrnsvImvhxKFFNb46s//gMBwrsbYT9a1258w8OtxoKtnflk2+dY1eEA5Vn9rtr5QalDeAsm2nEO/hnGtqpXeV5kgiMQj3e1Z0UB+qrCSbRlnXOp0LvzI/HTPKCjDcvAw9Im45CuK0JWM+glc1Yz1jLMiGTiDqVAu43DDP6brmTPpDEd2sYcYCu98i890Q12YIIow8ZFIMY5lrWayP9/Y7/jipfNJNDN9u7lg0mJ59cgkL/9K+hpTU5ciw== 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)(39860400002)(396003)(376002)(366004)(346002)(2906002)(921005)(16526019)(26005)(186003)(83380400001)(6486002)(8936002)(6506007)(66556008)(66946007)(55236004)(66476007)(44832011)(478600001)(6512007)(2616005)(316002)(54906003)(5660300002)(956004)(1006002)(52116002)(8676002)(6666004)(110136005)(86362001)(4326008)(7416002)(1076003)(110426009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?/HydlZAAdanJKqHkuBKTsk3CpJ0Y2ojF7AxXeV2rpBfoZAKNTbk8m/3KUXuY?= =?us-ascii?Q?UMff+JqTadQRHtx4c+7U+mUX56pbFFEJkDbUtRUMvfrzBa7nMRMQAnSkPl/n?= =?us-ascii?Q?WSlmvePJfLXAm/DCa4IcYHB4NNKrXjb9BLTqJZHkJ0IhA97DunhumjDbDkk9?= =?us-ascii?Q?EcM/RLWdVBoZhLZyH0fANpCKU1lHhP0Nzxrq1/iSNg6k3qs5uPu520PgVOKB?= =?us-ascii?Q?JvS5128gSs3GxE0jSl/s0XgH4lX9BStkZKZ3ekv4BxioUcNGaDhaHS0XJ2/M?= =?us-ascii?Q?7wnvvrpPs17ulJqOZNUEjo7ym7f5Ai6syaUACVj8ynTnCiMV61nZc1nYfdqr?= =?us-ascii?Q?CzgxUSOBOdAT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us-ascii?Q?VWvwC/8BEszeNt+cGKT1bltdf062GpqNBI03ZKlM9P6QguFdf4lHmPvQj/Od?= =?us-ascii?Q?wt8rXG7HFs1blADDTmieB411?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee156e07-81ec-4e28-f7e9-08d8e455eca2 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2021 06:21:37.0129 (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: VmNE6TNf6fwt27heJwareYRU2IBsX2YhAhaINgBlZhuucADF0l2Dy468o3bJ5+disWWuJGYyifTavOhkH6uF6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6611 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 v7: None Changes in v6: None 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 b5e0b5b22f1a..612a37970f14 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