Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1052962pxb; Tue, 9 Feb 2021 21:34:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgFQw5Z4WJ4FKxfvs1ymlshRrR21V20BK1jDLqqmU0XW5dUFk+mjqcfjOuYGGl1kAqsFa0 X-Received: by 2002:a17:906:4955:: with SMTP id f21mr1249458ejt.477.1612935244535; Tue, 09 Feb 2021 21:34:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612935244; cv=pass; d=google.com; s=arc-20160816; b=wRRz7mAd0ewfEs7vP2GCRmU7avQhVkzK4BqU5lq11p0GcgxFKpoz8CCCpDAX5mgLLs 4WjrrrfO5xc2J4ZU/CYi20sk8pRhayVMZ7y9Jt0pTnyng624QE1xlVbc+i7Yd+Hlz4vc fLtiSvwt7y/5poeK4dEBRMrxPLdUcNwPbKpGL6Kdrkh4NevqDyDPR+NZD+Exk/pdMYjl sWscGPJdlLSjdrurmOxMmCrw6gw2rPeLq+giweuJCEzO1pCB+UstK1VeO1T4c0qWipHT fDTPcqGrLKbRSZbulpn6Qc1dStWwkgY83UrtNCiqP4h8F1dTZaDCgJaplBkmX7NT1z/+ 5ZJg== 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=oLCvER8KAnvVaWbklgE+2NdSIiHSqUWsJc7oAFN1LO4=; b=i2UhLkj9BzgLIBGjMrlSaPhBfqq4W09b/JIAHnKz9BU+ZcstFolq4WPpGDQIayeetJ TL/SGEoeW2KkRoa8z1izVn6564Sq88shpPjjMDbDedlDR1bv3C7929ZbCze4NZmGW7C0 9mPv5qp23dCmRpVWViiyKLO07BOFGxLTLjigeTqH9vcrFkdUovSwylg9tx9fQrGVbxkE CW7+8Geyr7EWZxAFhjRWvJ9Vz87tlOd0DVH6MlSc2iroHsHH4EgG0sfss2sDY6A/d3Oc BTK6x9oPAg5Gc1arpSXGXRpein65TaX0xpLgGdKwMSAYAwNW8gEsIdp3EHiS9VLw1RxQ pdNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=V4XrOX9S; 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 l20si624906eje.712.2021.02.09.21.33.41; Tue, 09 Feb 2021 21:34:04 -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=V4XrOX9S; 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 S232311AbhBIPFn (ORCPT + 99 others); Tue, 9 Feb 2021 10:05:43 -0500 Received: from mail-am6eur05on2078.outbound.protection.outlook.com ([40.107.22.78]:55009 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231576AbhBIPFj (ORCPT ); Tue, 9 Feb 2021 10:05:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fvMBKH6BFYD/ZDjg5B7m1x/bly3UiXwubMC/yEIvwYI24f4W0KnjLMiBqkCz4YOw8/ZYUfDV980vbPlf8S3m+M7coUyv+364uFL/zd3hfd/Al+Ze61Szpqnrq+OSGVgy55iNNbQNpPEy7EBO59btXWhuG4hbgNNcey5VyORZL/KwCdVabnRLxKQO7ytvR59CS9j7wXoS7FYAs3o7lkPtCWTWrbdfLvPa1m6Il3vj9Dks5Xk3aO2XgEl8n88ebIuAWr7gAonDp6KSRYT7BWQYV2ZhuwQstd1qMZ47r2dDx3ynAQpDHtCWQTbSe9Sm9DAELmxXGI0RovGPYq4gFd/WXA== 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=oLCvER8KAnvVaWbklgE+2NdSIiHSqUWsJc7oAFN1LO4=; b=LmAprO4GRapqTfgkbibfwSySLBd/kqWdPXZY9knZHDO2BikhGZaUiOxRzZWXpOv+rD0x1keqpE3NhKzoRteCFB0HqLQwB+aqcSOCXQxDlvpvcyoX0/NRIZm6Mo9WRoqxOC5l31jvhMFPJkN+wo6CcyMvTvuCJiyPP/SFdXB3xIabEjpEyeHdv4G6yjFDz40Zy28fCO+xC6L0tdOsY9IC9Y+wmzIgjW5DSOKNpWSATOcyK8IvP7Z8lp2pBRVurEAi8bCvyFA5F2UvhUBls2u++KAG7MFFpYbnN77go6kvyTbziLm+2dLy/SPmXYdAk4r5hXZrQ59G50Bbia279zzEJQ== 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=oLCvER8KAnvVaWbklgE+2NdSIiHSqUWsJc7oAFN1LO4=; b=V4XrOX9SYZhiQZiLToj8OXQU5QFaWp9o1yel/jolLreik4Uk0FfBbE5jiWCwAGe91ujMDwGrgOiPGeWbI85cY5dadrWkcJ3w1WpAyNW+0ISx477dHJwH//ry2xi+R2iy97ZQCEkcgDpNyFZ6I077JVuSn4wmMupLVA+5Ao+RE/I= Authentication-Results: armlinux.org.uk; dkim=none (message not signed) header.d=none;armlinux.org.uk; dmarc=none action=none header.from=oss.nxp.com; Received: from AM0PR04MB5636.eurprd04.prod.outlook.com (2603:10a6:208:130::22) by AM0PR04MB6898.eurprd04.prod.outlook.com (2603:10a6:208:185::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17; Tue, 9 Feb 2021 15:04:49 +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; Tue, 9 Feb 2021 15:04:49 +0000 Date: Tue, 9 Feb 2021 20:34:33 +0530 From: Calvin Johnson To: Russell King - ARM Linux admin Cc: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Diana Madalina Craciun , linux-acpi@vger.kernel.org, Rob Herring , linux.cj@gmail.com, Jakub Kicinski , Heiner Kallweit , Frank Rowand , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Laurentiu Tudor Subject: Re: [net-next PATCH v5 07/15] net: mdiobus: Introduce fwnode_mdiobus_register_phy() Message-ID: <20210209150433.GB3248@lsv03152.swis.in-blr01.nxp.com> References: <20210208151244.16338-1-calvin.johnson@oss.nxp.com> <20210208151244.16338-8-calvin.johnson@oss.nxp.com> <20210208174013.GN1463@shell.armlinux.org.uk> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210208174013.GN1463@shell.armlinux.org.uk> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [14.142.151.118] X-ClientProxiedBy: SGXP274CA0021.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::33) 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 SGXP274CA0021.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Tue, 9 Feb 2021 15:04:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fa66bcac-b617-42e8-91a3-08d8cd0c0a7c X-MS-TrafficTypeDiagnostic: AM0PR04MB6898: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aRbu5jcMQBGNtG6fa7Gdn7dds57Sj4w4qCI3fcf2yaZg3YTJOLIZuPUNafj/KVuzOcGWeIOFqzYpl1ySwCGenKGABcxUMFpdXNWzjrM3CQjVeUaYEZ7XnwqTUVHs+2Ekd3DU0nNhUbl2zHMp0wjA145Mky39YOaYklyKPZ9D/0WTyMQ1xM3r1qhsz3Q6qstYOfSvU7RmgC57MzvwNwZUCm0Zu7B7GqQvGOihMGc0/q82o0YpFXU0M/Z/x0Fl3qQAyTGYX8P3PJ7LfhRFEbVn46H+LmrLOQ6lslXkGOdFjL+KQWnLx5PYHYdCJGaCf1tndIWbZ6BqWBoPjLw4zOx+nutehzNDMGKX2UoTbfHNDrAAnQAOLngeTvVcUdOsgkPKAJ/lwnvzyN88q+ce2DVL3/9akBqHrVoiuoYKwT9rzOs3eQDbJt5IyyCGmqX9AZ4QEsN+Th8SDXoDX1FHfqG08dsnKAOhVOvtjwS7AtV27qPJKp25fhSSdaIJaeiHdBRtZQ+MVYQGKcRZfp8m7uqo9AKMlKZLANggu+BJflgluUqgAV/6Y1q8wPPO426quLAQ90+h0wfi7KH7mbfLM+LZlw== 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)(39860400002)(376002)(136003)(396003)(346002)(366004)(6916009)(86362001)(316002)(8936002)(4326008)(66946007)(66556008)(26005)(66476007)(7416002)(6506007)(55236004)(8676002)(956004)(9686003)(5660300002)(186003)(16526019)(6666004)(1006002)(478600001)(1076003)(33656002)(83380400001)(54906003)(55016002)(44832011)(7696005)(52116002)(2906002)(110426009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?qUPDiunlRsZDxETHAACI25GVAJO0hss3DIBrbvbs60s2Lsh7uYw2Ifb9TTlx?= =?us-ascii?Q?/f2DC0ecTUmOALJTy1CW0xOFDmaWclntnAllOeEnfvsHg5q/MkyuiVmlhWOx?= =?us-ascii?Q?SuoEH5fysW6ft/oGpN16zIRGMiGocdLso9MFYoxsBDNBQfrsRw5pg8XcZqF0?= =?us-ascii?Q?4p40LNO3oQLKCCcuBwe08h7+zM1WIeSwL2z4oDcHx6bbqD56DnZSkWJy0olj?= =?us-ascii?Q?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XjK7RwSeluWOIewakXDV?= =?us-ascii?Q?M8xGVlC1F53uiy7ohoLRZ9sHko9DtIq70rGOwEnZTBpgcdFFptw4Fy2MYcSx?= =?us-ascii?Q?qKLn5/aMtTlfnj6U7BzF+SUXkzA5MhIWlIrOIwKhiTo4sHwq09agh+nRZO0I?= =?us-ascii?Q?MKmuDELOkB2DdBLebViTqhZYSdnINgVtds5An/CkoKErJ9Gd5gkdt55FH0gY?= =?us-ascii?Q?c3jj7F1QV5wqK+Vwv3DhULNqZ/RDdRqKEH6zvUEQ6EJSJw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa66bcac-b617-42e8-91a3-08d8cd0c0a7c X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB5636.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2021 15:04:49.3340 (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: 9WvZmIIkYe3XAWyWXVbOaiJ2E6g4Zs1xlc0908BrrgiVazAnlbV03/SyECqoSBWO43tpaOUna3H9WoAlP6dogA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6898 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 05:40:13PM +0000, Russell King - ARM Linux admin wrote: > On Mon, Feb 08, 2021 at 08:42:36PM +0530, Calvin Johnson wrote: > > +int fwnode_mdiobus_register_phy(struct mii_bus *bus, > > + struct fwnode_handle *child, u32 addr) > > +{ > > + struct mii_timestamper *mii_ts; > > If you initialise this to NULL... > > > + struct phy_device *phy; > > + bool is_c45 = false; > > + u32 phy_id; > > + int rc; > > + > > + if (is_of_node(child)) { > > + mii_ts = of_find_mii_timestamper(to_of_node(child)); > > + if (IS_ERR(mii_ts)) > > + return PTR_ERR(mii_ts); > > + } > > + > > + rc = fwnode_property_match_string(child, "compatible", "ethernet-phy-ieee802.3-c45"); > > + if (rc >= 0) > > + is_c45 = true; > > + > > + if (is_c45 || fwnode_get_phy_id(child, &phy_id)) > > + phy = get_phy_device(bus, addr, is_c45); > > + else > > + phy = phy_device_create(bus, addr, phy_id, 0, NULL); > > + if (IS_ERR(phy)) { > > + if (mii_ts && is_of_node(child)) > > Then you don't need is_of_node() here. > > > + /* phy->mii_ts may already be defined by the PHY driver. A > > + * mii_timestamper probed via the device tree will still have > > + * precedence. > > + */ > > + if (mii_ts) > > + phy->mii_ts = mii_ts; > > Should this be moved out of the if() case? > > I'm thinking of the future where we may end up adding mii timestamper > support for ACPI. Right. I'll take case of these in next version. Thanks Calvin