From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 6B732C4363D for ; Sat, 3 Oct 2020 18:00:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0235E206C1 for ; Sat, 3 Oct 2020 18:00:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="arzCMJx/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725805AbgJCSAw (ORCPT ); Sat, 3 Oct 2020 14:00:52 -0400 Received: from mail-eopbgr150077.outbound.protection.outlook.com ([40.107.15.77]:36250 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725804AbgJCSAw (ORCPT ); Sat, 3 Oct 2020 14:00:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NVslCIWmG+IznKDe0CpsX856RLOUq2XmWkp+ItzArg4psijLMQ4boEmyIBMvVwEi3LHZksP7CiHze6IPiVuYnrTwPmsW8iyKkNp4qYKrLUNnFrO5Kxc58c/hqCekrIFBoO2cTfvHo2O4iGkJ+ZyqDGqhdawJCobaqqrEZlp/m5sE6LLYBYI10iF7RH9piu6Lvso3KDJJB8qBzuZHil1QKsI3elHTEdVgfBkhhiljDpYudcG9aL30v3/6CMPYB2F48Gkhiuidj84UGEXIWl+7HxVMWj/HZu+yE2QLKHmf84l5nvTSP4g9d3DRd4olMWAbew92/7PBHNn0MKOlPb0cJw== 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=rdYDxbmdkqYfvLRr6al7T4kKPusqT4+fqk4AUJPEA18=; b=Bvas6DdShj/C8bIVVnqAfef9i0CuCD/Z5JuGYbxt0sJDuWSwmcbNOLMX6VvMQTHZpnWuyXjFJmsKoPidNaeETDjLIYRpRbGkDuP0f6XIvJpzP68sBta1PWEmsgSMhgtBIleCro9NbkEvYNLeSfZpR1XOmlX8T6CpbT1thfmyYmedy5b2kMeHULyheoJ4bKdjqg3AWQrEUFO4/sz2H3TEWQm82JyJEAMW4bZkDJRM4sr6E/D/BqiPdf6YTI64ZVdkfIEUzzAOyEXHdovNjNivrPxgP0Q/RAuQzIiLoWHVhOpumJfMkpXJV1+ppbnOC17l+X8JOjYK3baweXXIuvKJxw== 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=rdYDxbmdkqYfvLRr6al7T4kKPusqT4+fqk4AUJPEA18=; b=arzCMJx/28OJM+3R5VIGelhw8i8OiCJpgTdH76DlmnryeAvMj+dftBWbfGCfki0tnnmGMr8YYBj2wnWBTQw/bow+9tGubAXjjRWKE3ryjRcGwLGy5zVIbi9Z4vMXsVOtgEJvGxRSiMMtKQI8cQax3knZXa6c8N7tDTjyu56EX+E= 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 AM0PR04MB3955.eurprd04.prod.outlook.com (2603:10a6:208:56::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Sat, 3 Oct 2020 18:00:47 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a997:35ae:220c:14ef]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a997:35ae:220c:14ef%7]) with mapi id 15.20.3433.042; Sat, 3 Oct 2020 18:00:47 +0000 Date: Sat, 3 Oct 2020 23:30:34 +0530 From: Calvin Johnson To: Grant Likely Cc: "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 , linux-kernel@vger.kernel.org, linux.cj@gmail.com, netdev@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Diana Madalina Craciun , Laurentiu Tudor , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , nd Subject: Re: [net-next PATCH v1 3/7] net: phy: Introduce fwnode_get_phy_id() Message-ID: <20201003180034.GC28093@lsv03152.swis.in-blr01.nxp.com> References: <20200930160430.7908-1-calvin.johnson@oss.nxp.com> <20200930160430.7908-4-calvin.johnson@oss.nxp.com> <11e6b553-675f-8f3d-f9d5-316dae381457@arm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11e6b553-675f-8f3d-f9d5-316dae381457@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR06CA0191.apcprd06.prod.outlook.com (2603:1096:4:1::23) 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 SG2PR06CA0191.apcprd06.prod.outlook.com (2603:1096:4:1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38 via Frontend Transport; Sat, 3 Oct 2020 18:00:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 96a0f883-ba0f-4f67-eb78-08d867c6410a X-MS-TrafficTypeDiagnostic: AM0PR04MB3955: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wFECbsmTjk1SRFIqDwN0DD0nKzMyT9dcRvHCHyfTuXIolRqDM31cgNnaYhSS2thwP7jGxGNCpGu2H7Wdv2yFCcFMafatCJz0AHFtEBqjhT13gStHKvDkgKXfEVmB2rQUjiCksEsQd4ibrTcJNLA7cPjhbjBUi/Nm16ZQoHd7uLY9NTTEqvvTnc6WOHuJajmosLFS9G+VKIpmelH1b9QN+V/tZ0Qd72+f6MdWyUmWtAHqHCgzDN+HcaFsWOt7hXTSWH7Lu2xNQA8SoGWAKmSxhzEh5+xhIc4Xlp9H36McDlbmwYoWUyBK9WGxg09ukuSBpz1vjfQTnttht7C3g+QAiSkgMIqbRecHLfqmqbvx7HeyoCI7wSq9HUD2hheLvm6O 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)(346002)(366004)(396003)(376002)(39850400004)(136003)(66946007)(66476007)(54906003)(316002)(55236004)(9686003)(16526019)(26005)(5660300002)(86362001)(4326008)(186003)(66556008)(956004)(7696005)(55016002)(83380400001)(2906002)(7416002)(53546011)(8676002)(6916009)(8936002)(1076003)(6666004)(6506007)(52116002)(1006002)(33656002)(478600001)(44832011)(110426005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +ejWv0W7W9mhLrFdw4YzI2Xm3vqLmhbtJpQjw73Bo8AICqyRLE2JX47q06GouLgqDNdXTLy3HX2IKXnm4WHCC9DCzENQ/wU6YT5gUn9C5q4rGrhIfiYeW6VGJwxNZX359I37/SfRzDjnS7qIXs3g3WAac0FdOwJlmYZH3pMAltjvh80EYx981zMsy1xCaE7S4EGXVNaOnMVQPTbKRBwHJ6+DhdEto0l2OnxDk6g9k6iP7fHcwAv6EO+rqcy8T0Uu2UxyPlPJ5fq5rNAOIVfiAw/0IOHASlrjix3GmnrutxoHdUAKDZ+YXna1V7LMAyLnLoaZdEi6F7aro8asSj1uOZyY/hUtInlfzwLJxB4l/OZQ4Ci0hNpXYxY4yDZNJmbN1gULQBe5uTb5mV2GO0baxwuQNSKha1/XO1+MEh+dKIr1FLl809e9xfXGFD2Y7bXCep1QvvAK4abO4javwCltHC0XDl4aTjf5UJxoxJGPdqVIpE8YupFTqia4ivF4igvZeVO3Tgp23jr22zcC5DFPXnXOjnHmgv7N1BZSP00/H5u0XO72EZzFiPCgLmshRyJQV9IvjI9XliTeyHf0NBw//NSw5jqLLITEinDTcqOL6UysrsaW71ITKB4unq3PfYb0/PGPjy6jnSc1dipPYW+TOQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96a0f883-ba0f-4f67-eb78-08d867c6410a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2020 18:00:47.2821 (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: 03nIpjG04HlXJtrmsxCflBY09UC0/jFKc0/jOllUbgAM37+wqh+5lQwHaTYPY/UKw8SzmGVcdEj/jEPpxvgpWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3955 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Fri, Oct 02, 2020 at 12:05:14PM +0100, Grant Likely wrote: > > > On 30/09/2020 17:04, Calvin Johnson wrote: > > Extract phy_id from compatible string. This will be used by > > fwnode_mdiobus_register_phy() to create phy device using the > > phy_id. > > > > Signed-off-by: Calvin Johnson > > --- > > > > drivers/net/phy/phy_device.c | 32 +++++++++++++++++++++++++++++++- > > include/linux/phy.h | 5 +++++ > > 2 files changed, 36 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > > index c4aec56d0a95..162abde6223d 100644 > > --- a/drivers/net/phy/phy_device.c > > +++ b/drivers/net/phy/phy_device.c > > @@ -9,6 +9,7 @@ > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > +#include > > #include > > #include > > #include > > @@ -845,6 +846,27 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) > > return 0; > > } > > +/* Extract the phy ID from the compatible string of the form > > + * ethernet-phy-idAAAA.BBBB. > > + */ > > +int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id) > > +{ > > + unsigned int upper, lower; > > + const char *cp; > > + int ret; > > + > > + ret = fwnode_property_read_string(fwnode, "compatible", &cp); > > + if (ret) > > + return ret; > > + > > + if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { > > + *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); > > + return 0; > > + } > > + return -EINVAL; > > +} > > +EXPORT_SYMBOL(fwnode_get_phy_id); > > This block, and the changes in patch 4 duplicate functions from > drivers/of/of_mdio.c, but it doesn't refactor anything in > drivers/of/of_mdio.c to use the new path. Is your intent to bring all of the > parsing in these functions of "compatible" into the ACPI code path? > > If so, then the existing code path needs to be refactored to work with > fwnode_handle instead of device_node. > > If not, then the DT path in these functions should call out to of_mdio, > while the ACPI path only does what is necessary. I'll work on refactoring as Florian and Rob are also suggesting the same. Thanks Calvin From mboxrd@z Thu Jan 1 00:00:00 1970 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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 5430FC4363D for ; Sat, 3 Oct 2020 18:02:31 +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 DBCDC206C1 for ; Sat, 3 Oct 2020 18:02:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="O/DJvwJM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="arzCMJx/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBCDC206C1 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:In-Reply-To:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=y7FuXJWF2RM2UDZYcIUeniIITHUZ8OsYa3OL7ps2lMc=; b=O/DJvwJMELSd11QVX6Um/9aYl u2RYwnEmw//Zey/CGsICRqjRpC9lpuN4OzU5RiJ8GKP0LqujgliX4FVgOL5fJfM6EWvlHGXVVaKUx Mchf91KFJwxlUQnb7dhQc113ncJDcZlAY/S+e7mc9L0i9rh5HVbrwS4fc1HNjE1af9wWOaO3Mn+/N YQBqDvVW0FdmhPExV8TJ6NRzqW2Is6nN2k2dBp76dDlKfndIz95OYJeixzescnkTLHrKQx1Q7VFZn 135aAaUn8VQlD2LYYuB26Xsc86PbTiXXZLr25nz+ytx4iIPC6VV7WD3vzQmtzlM0ucJsn7Hw6zTj0 GWUkSuoqw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOlq1-0002n6-Gw; Sat, 03 Oct 2020 18:00:53 +0000 Received: from mail-eopbgr150081.outbound.protection.outlook.com ([40.107.15.81] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOlpy-0002mU-M3 for linux-arm-kernel@lists.infradead.org; Sat, 03 Oct 2020 18:00:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NVslCIWmG+IznKDe0CpsX856RLOUq2XmWkp+ItzArg4psijLMQ4boEmyIBMvVwEi3LHZksP7CiHze6IPiVuYnrTwPmsW8iyKkNp4qYKrLUNnFrO5Kxc58c/hqCekrIFBoO2cTfvHo2O4iGkJ+ZyqDGqhdawJCobaqqrEZlp/m5sE6LLYBYI10iF7RH9piu6Lvso3KDJJB8qBzuZHil1QKsI3elHTEdVgfBkhhiljDpYudcG9aL30v3/6CMPYB2F48Gkhiuidj84UGEXIWl+7HxVMWj/HZu+yE2QLKHmf84l5nvTSP4g9d3DRd4olMWAbew92/7PBHNn0MKOlPb0cJw== 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=rdYDxbmdkqYfvLRr6al7T4kKPusqT4+fqk4AUJPEA18=; b=Bvas6DdShj/C8bIVVnqAfef9i0CuCD/Z5JuGYbxt0sJDuWSwmcbNOLMX6VvMQTHZpnWuyXjFJmsKoPidNaeETDjLIYRpRbGkDuP0f6XIvJpzP68sBta1PWEmsgSMhgtBIleCro9NbkEvYNLeSfZpR1XOmlX8T6CpbT1thfmyYmedy5b2kMeHULyheoJ4bKdjqg3AWQrEUFO4/sz2H3TEWQm82JyJEAMW4bZkDJRM4sr6E/D/BqiPdf6YTI64ZVdkfIEUzzAOyEXHdovNjNivrPxgP0Q/RAuQzIiLoWHVhOpumJfMkpXJV1+ppbnOC17l+X8JOjYK3baweXXIuvKJxw== 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=rdYDxbmdkqYfvLRr6al7T4kKPusqT4+fqk4AUJPEA18=; b=arzCMJx/28OJM+3R5VIGelhw8i8OiCJpgTdH76DlmnryeAvMj+dftBWbfGCfki0tnnmGMr8YYBj2wnWBTQw/bow+9tGubAXjjRWKE3ryjRcGwLGy5zVIbi9Z4vMXsVOtgEJvGxRSiMMtKQI8cQax3knZXa6c8N7tDTjyu56EX+E= 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 AM0PR04MB3955.eurprd04.prod.outlook.com (2603:10a6:208:56::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.34; Sat, 3 Oct 2020 18:00:47 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a997:35ae:220c:14ef]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a997:35ae:220c:14ef%7]) with mapi id 15.20.3433.042; Sat, 3 Oct 2020 18:00:47 +0000 Date: Sat, 3 Oct 2020 23:30:34 +0530 From: Calvin Johnson To: Grant Likely Subject: Re: [net-next PATCH v1 3/7] net: phy: Introduce fwnode_get_phy_id() Message-ID: <20201003180034.GC28093@lsv03152.swis.in-blr01.nxp.com> References: <20200930160430.7908-1-calvin.johnson@oss.nxp.com> <20200930160430.7908-4-calvin.johnson@oss.nxp.com> <11e6b553-675f-8f3d-f9d5-316dae381457@arm.com> Content-Disposition: inline In-Reply-To: <11e6b553-675f-8f3d-f9d5-316dae381457@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR06CA0191.apcprd06.prod.outlook.com (2603:1096:4:1::23) 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 SG2PR06CA0191.apcprd06.prod.outlook.com (2603:1096:4:1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38 via Frontend Transport; Sat, 3 Oct 2020 18:00:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 96a0f883-ba0f-4f67-eb78-08d867c6410a X-MS-TrafficTypeDiagnostic: AM0PR04MB3955: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wFECbsmTjk1SRFIqDwN0DD0nKzMyT9dcRvHCHyfTuXIolRqDM31cgNnaYhSS2thwP7jGxGNCpGu2H7Wdv2yFCcFMafatCJz0AHFtEBqjhT13gStHKvDkgKXfEVmB2rQUjiCksEsQd4ibrTcJNLA7cPjhbjBUi/Nm16ZQoHd7uLY9NTTEqvvTnc6WOHuJajmosLFS9G+VKIpmelH1b9QN+V/tZ0Qd72+f6MdWyUmWtAHqHCgzDN+HcaFsWOt7hXTSWH7Lu2xNQA8SoGWAKmSxhzEh5+xhIc4Xlp9H36McDlbmwYoWUyBK9WGxg09ukuSBpz1vjfQTnttht7C3g+QAiSkgMIqbRecHLfqmqbvx7HeyoCI7wSq9HUD2hheLvm6O 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)(346002)(366004)(396003)(376002)(39850400004)(136003)(66946007)(66476007)(54906003)(316002)(55236004)(9686003)(16526019)(26005)(5660300002)(86362001)(4326008)(186003)(66556008)(956004)(7696005)(55016002)(83380400001)(2906002)(7416002)(53546011)(8676002)(6916009)(8936002)(1076003)(6666004)(6506007)(52116002)(1006002)(33656002)(478600001)(44832011)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: +ejWv0W7W9mhLrFdw4YzI2Xm3vqLmhbtJpQjw73Bo8AICqyRLE2JX47q06GouLgqDNdXTLy3HX2IKXnm4WHCC9DCzENQ/wU6YT5gUn9C5q4rGrhIfiYeW6VGJwxNZX359I37/SfRzDjnS7qIXs3g3WAac0FdOwJlmYZH3pMAltjvh80EYx981zMsy1xCaE7S4EGXVNaOnMVQPTbKRBwHJ6+DhdEto0l2OnxDk6g9k6iP7fHcwAv6EO+rqcy8T0Uu2UxyPlPJ5fq5rNAOIVfiAw/0IOHASlrjix3GmnrutxoHdUAKDZ+YXna1V7LMAyLnLoaZdEi6F7aro8asSj1uOZyY/hUtInlfzwLJxB4l/OZQ4Ci0hNpXYxY4yDZNJmbN1gULQBe5uTb5mV2GO0baxwuQNSKha1/XO1+MEh+dKIr1FLl809e9xfXGFD2Y7bXCep1QvvAK4abO4javwCltHC0XDl4aTjf5UJxoxJGPdqVIpE8YupFTqia4ivF4igvZeVO3Tgp23jr22zcC5DFPXnXOjnHmgv7N1BZSP00/H5u0XO72EZzFiPCgLmshRyJQV9IvjI9XliTeyHf0NBw//NSw5jqLLITEinDTcqOL6UysrsaW71ITKB4unq3PfYb0/PGPjy6jnSc1dipPYW+TOQ== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96a0f883-ba0f-4f67-eb78-08d867c6410a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2020 18:00:47.2821 (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: 03nIpjG04HlXJtrmsxCflBY09UC0/jFKc0/jOllUbgAM37+wqh+5lQwHaTYPY/UKw8SzmGVcdEj/jEPpxvgpWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB3955 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201003_140050_731454_21CCAAF1 X-CRM114-Status: GOOD ( 25.03 ) 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: Andrew Lunn , Heikki Krogerus , "Rafael J . Wysocki" , Cristi Sovaiala , Ioana Ciornei , Florian Fainelli , Russell King - ARM Linux admin , Diana Madalina Craciun , linux-acpi@vger.kernel.org, Andy Shevchenko , Jakub Kicinski , Florin Laurentiu Chiculita , Madalin Bucur , nd , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Linton , linux.cj@gmail.com, "David S. Miller" , Heiner Kallweit Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 02, 2020 at 12:05:14PM +0100, Grant Likely wrote: > > > On 30/09/2020 17:04, Calvin Johnson wrote: > > Extract phy_id from compatible string. This will be used by > > fwnode_mdiobus_register_phy() to create phy device using the > > phy_id. > > > > Signed-off-by: Calvin Johnson > > --- > > > > drivers/net/phy/phy_device.c | 32 +++++++++++++++++++++++++++++++- > > include/linux/phy.h | 5 +++++ > > 2 files changed, 36 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > > index c4aec56d0a95..162abde6223d 100644 > > --- a/drivers/net/phy/phy_device.c > > +++ b/drivers/net/phy/phy_device.c > > @@ -9,6 +9,7 @@ > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > +#include > > #include > > #include > > #include > > @@ -845,6 +846,27 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id) > > return 0; > > } > > +/* Extract the phy ID from the compatible string of the form > > + * ethernet-phy-idAAAA.BBBB. > > + */ > > +int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id) > > +{ > > + unsigned int upper, lower; > > + const char *cp; > > + int ret; > > + > > + ret = fwnode_property_read_string(fwnode, "compatible", &cp); > > + if (ret) > > + return ret; > > + > > + if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { > > + *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); > > + return 0; > > + } > > + return -EINVAL; > > +} > > +EXPORT_SYMBOL(fwnode_get_phy_id); > > This block, and the changes in patch 4 duplicate functions from > drivers/of/of_mdio.c, but it doesn't refactor anything in > drivers/of/of_mdio.c to use the new path. Is your intent to bring all of the > parsing in these functions of "compatible" into the ACPI code path? > > If so, then the existing code path needs to be refactored to work with > fwnode_handle instead of device_node. > > If not, then the DT path in these functions should call out to of_mdio, > while the ACPI path only does what is necessary. I'll work on refactoring as Florian and Rob are also suggesting the same. Thanks Calvin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel