Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1052394pxu; Thu, 17 Dec 2020 00:32:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMawBu7CNE0nbbbk+6npSKe0ow5nP1jJHMb8hxBdrOqRkFsB7a0beQ/97TgpqRi89fE/gw X-Received: by 2002:a17:906:7f0b:: with SMTP id d11mr13833134ejr.7.1608193953866; Thu, 17 Dec 2020 00:32:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1608193953; cv=pass; d=google.com; s=arc-20160816; b=Z/01JT9UItFDN7inecPHZ51/mhSNrFsRhBPKLexN+lisqBqFAEVXcZ3S4jTOPVnByd N/Kh/m6wbQgNcpDmJbFcypXY7CQqzk+oZI7MPbdQofifHRFbqM8Ybvoi3plJ5DaJjn4I Z909IdEfK59sTca+ZRscJua01Kam7WoYxr20PClj2pmT1T7Wo46nXbRyNKZa1rmaJafU AXmxlmUsvL7wZRPvjTOUNLpuo0qTibD2Ph2aSY1EfV/HqGSSQIzuXW5q0ZDQ6KCeg1C5 GAPJ6CVLgziNPHdkB5t5yE29DGe7VIAi2lGb1MZ3of6h/8WkiZVOem7gcaCruzE9WCRs AWyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=MydZuylGKOYhvw0U16zsCggDRgIx3owZPAw59mNCzNQ=; b=Ok1hA1SdawfvNQWUQK25dqSBGhU1Kj5epwvGvlbchjYV0yDKwhJaCQXMDrwC0bgOW1 NV0JviRRocmjZSbYLRBuepzHtxKUPRXV6FbEaynoP8QlgKkXlY8cRCtazR8EdZfDpABp WYgaasxXwtLhaudVBATemKQGOl3g8shl9lzuJoD7vfJhhrotzO/sykpBXpy0tAdo1aV2 egXwqcLMNjPA3b+nUTc+oQro2ecGTaE6+OLi+PgTcLbZHLsJf6+43nC4hHYMIH8s+WoP UgSHAJIFzAIxPaowulkNhLMvTczPHhiKzIzVzPZ+IDqTt3hk24qBDDoLowELrtyLazqt lT5Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=IY94xYyG; 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 u1si2114403ejt.709.2020.12.17.00.32.11; Thu, 17 Dec 2020 00:32:33 -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=IY94xYyG; 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 S1726613AbgLQI3M (ORCPT + 99 others); Thu, 17 Dec 2020 03:29:12 -0500 Received: from mail-eopbgr70050.outbound.protection.outlook.com ([40.107.7.50]:17632 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726160AbgLQI3L (ORCPT ); Thu, 17 Dec 2020 03:29:11 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ffSyFEDr+9YgCsb7PTKyjViye1CcHBy33ENqb2QfZOPJHIpLJssx3yLSBTAuPNiXOUnVINfj8alwCm2RXX/r3FPVnSVqHrr3Id5feqE35BThQ9ujelfhc2yAfb77nSQnBdHKaKZR0ZoA7qIXt2BG/MwbH0H7TGt03eI7zgF0ceL0h/2Gv3BVi8rpCzVenf9jOk3cGMK6ltwapYZ/2yOksHw2jrNleja1/4iy74GZcL1ip/IBiFt9ArXpkA1AqKvT5Fy7v01jX+s4d1Q0tpMo0JmRbg8o7G403VwVI5vMjyWZcUwZtb7p/6ZmJJCgF3IWB0BD3wgqv+K85GuPLY8yew== 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=MydZuylGKOYhvw0U16zsCggDRgIx3owZPAw59mNCzNQ=; b=eUP1P8eWYtreuFux9HunpD9o87r0QVPcTrLrpujkvqgETyl44KhSugqZCa/fJ1Zmt/VDtgUxmzUPQkcPg+IzHuKFN9IdpIHcLFGjJq7KqQel2QNj2ZWMR558UVBKvCBKy4gUFq8PP6f5KNMC7E6E4YbDCW9nYOuMr4ANV/tG7uFyZb85Wp2stGKMU3+e5FfPdMyQoBzh0IMuxMaxO8dYVZMfMdYmcITxqYn94ohIMuN7aOq/Cu3xijMTKjmFZJwmtKUK9Se+5We4+ELRoDRJ53Fdrhpg8c2a02I3KVkLHUGcsWbLCGiDiRjdCbOFOa6be2gSqNGz2YSHL6T4mBju7Q== 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=MydZuylGKOYhvw0U16zsCggDRgIx3owZPAw59mNCzNQ=; b=IY94xYyG+O+PXByHcavIpi9MVWy04JQssNAmQENUlJq+078DNFMDFkG2EDNrUR/upjWaktZ9653elYicJiWhWn1tKg3cKLkP7RShtntuV4LP6XXOrZ/PlwrvfJv61yBnlwviCbRLzO9DasfFOsZ/YvmE3YDulJNKKYC3DtoiMn4= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM8PR04MB7891.eurprd04.prod.outlook.com (2603:10a6:20b:237::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.19; Thu, 17 Dec 2020 08:28:20 +0000 Received: from AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd]) by AM0PR04MB5636.eurprd04.prod.outlook.com ([fe80::a891:518d:935c:30dd%6]) with mapi id 15.20.3654.020; Thu, 17 Dec 2020 08:28:20 +0000 Date: Thu, 17 Dec 2020 13:58:04 +0530 From: Calvin Johnson To: Andy Shevchenko Cc: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , 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 , "linux.cj" , Laurentiu Tudor , Diana Madalina Craciun , ACPI Devel Maling List , Linux Kernel Mailing List , linux-arm Mailing List , netdev , "David S. Miller" , Heiner Kallweit , Jakub Kicinski Subject: Re: [net-next PATCH v2 04/14] net: phy: Introduce fwnode_get_phy_id() Message-ID: <20201217082804.GB19657@lsv03152.swis.in-blr01.nxp.com> References: <20201215164315.3666-1-calvin.johnson@oss.nxp.com> <20201215164315.3666-5-calvin.johnson@oss.nxp.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SG2PR04CA0130.apcprd04.prod.outlook.com (2603:1096:3:16::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 SG2PR04CA0130.apcprd04.prod.outlook.com (2603:1096:3:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 17 Dec 2020 08:28:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d3fbc94b-8bd5-46b8-2c38-08d8a265b61a X-MS-TrafficTypeDiagnostic: AM8PR04MB7891: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PSg1uidOuWftp9xap8h6LmcPJdLBWD2KhUVff9Vsap5/a4Gadr5rsuizV8l3nEaQyeY89s7VdRBuY9mlCpp26F9NSkjdAHRq8K/7JDIg+xA1HQq87Lau/9F7ybFM+TqS60fXkpbFDgoLlKAYcZ0N6ep8/kyvbCeKAB1HDJWvzcpVJ9XTLxiCwCoI7/WZBTe77Rg8IshoBRXglFIZFrCccosa5uMXbC7G2MLchQapuJNp/kSdTDuo2zTj4oGofp7drnaS+YTbfOEViRU3/vP/1isvCZC844vDQ7a4dFJYAZJEKkknMpaGsmim4BPpWj7mpTxLeCDZPEjnheKs/2IhHJPGhtqDETYGjNZ4OmNq77hlN+mp9hVUHZRIsI4LU6xT 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)(376002)(366004)(39860400002)(346002)(396003)(7696005)(53546011)(16526019)(66476007)(8676002)(5660300002)(4326008)(86362001)(52116002)(66556008)(1076003)(33656002)(4744005)(2906002)(6666004)(316002)(6506007)(8936002)(54906003)(26005)(6916009)(1006002)(956004)(44832011)(478600001)(66946007)(9686003)(55016002)(186003)(55236004)(7416002)(110426006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?x3gInD5jJAONIC789sblHqo89ZsKKrsskKFmuiT1Mqkx5F3FFOSsSfRG2a51?= =?us-ascii?Q?ijR/RgPNmKLyu9LniE08dcIP4bGxGOgRczyVC3ICMkVwXP15Zhtin/V02Za1?= =?us-ascii?Q?58cbCYjsC0JBzqYVi0vr9ZCdOaESyWYnCxN9D781SZIjldmSMshjQyqwwU5Q?= =?us-ascii?Q?f/MUNPDQXEWhZGa/8RvgnGn16NmhzREIQF+IGxPlJ/wrxa6sS7ZTte217a+4?= =?us-ascii?Q?YT/ctwk9Rwq8UoOrVQPVtE13D5+VBbGRCrcx7tQC44XrwaOPUOjNVBhnZM8+?= =?us-ascii?Q?UrPO6dOoN7okT/ibwUYhR5M2slPuMJmdQ2amNzQ1EyA+geBJvQAHa28vSYNO?= =?us-ascii?Q?YqiGJio8Kqo19ep09tgfbaMlHeFDZhzCkAVXUsEymaq/cfBP1/EjmNntjfh9?= =?us-ascii?Q?BKb3rPRpo9kI3TcHWWZVdmYnwmNpBuqDQCgQ1cNxeEYLzIMY1zboTHnjOPnz?= =?us-ascii?Q?AaPgsIGVR0I3/jIuqfmcxZSYXC1pczd3LC/wx9kYewuuEbfZbCxHjDEdz19w?= =?us-ascii?Q?3aAl4Gdd8+/MIC56dYeD8YWtIfw5cbsZKlxc2qmO8bZRw4R3N2+KlsuQgfAe?= =?us-ascii?Q?dYzBD5FjRC24hCEQtqlDX8NnmSuI8EVCSlqvb8GReOq349KtxjvRwMPdDPMq?= =?us-ascii?Q?/W3Dbu/rvMhVOkdWSLrGz3NuT9MInQz+5Z0zn07ntwKvnrkRbf/NEbTH1P23?= =?us-ascii?Q?7vH4xxriUP6pzRPLnJQ5cuqUtDCnWaVQje9mmCNfKn4Vwvs7rVQ/kPEeoz1T?= =?us-ascii?Q?lKb38gudiys+CS00uelS5/jwQDz7/QjHfn7+KqCWlOl120U/isjOrjEHLMZI?= =?us-ascii?Q?9k7sa0g9wM5LadCiBNvz/YEKx6oB7+/YeP4W+bNCDjcGmTroQ+gDlAbPbbdX?= =?us-ascii?Q?G7yO6ZKy6QoY5gM5FF72N2EgrOK30mE47xcH8ZKIxhUfmfQE5BWQaZCBQJjn?= =?us-ascii?Q?r2St5df243fQ5gwQ8Nn43OlLjGmPT9kSMwpqFOvPQSQNxrH6SKolh/zA2D12?= =?us-ascii?Q?4rG5?= 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: 17 Dec 2020 08:28:20.2391 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: d3fbc94b-8bd5-46b8-2c38-08d8a265b61a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m4qtuilQgTAkztOG+BIT0d7sOyqFqDrswpPtL4Ca6J71EzXCUVqQrxiVLBydm0iYHUrnlWEa/yTJWCtsJaAwNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7891 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 15, 2020 at 07:28:10PM +0200, Andy Shevchenko wrote: > On Tue, Dec 15, 2020 at 6:44 PM 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. > > ... > > > + if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { > > + *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); > > + return 0; > > + } > > + return -EINVAL; > > Perhaps traditional pattern, i.e. > if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) != 2) > return -EINVAL; > > *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); > return 0; > > And perhaps GENMASK() ? Sure. Will rewrite accordingly. Thanks Calvin