Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4142396pxb; Mon, 8 Feb 2021 08:55:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJynFmFwRjZbXEQfo+/4CQFFvlNM61KoBZHw9niEltgY5SXpxFaX5wh/7gVJzJEqC+NhbOzG X-Received: by 2002:aa7:d60f:: with SMTP id c15mr18156773edr.291.1612803300034; Mon, 08 Feb 2021 08:55:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1612803300; cv=pass; d=google.com; s=arc-20160816; b=gMyY8D4rSetDqH1yKZY8/uk7gX85ypaCHNb6TphM0qIm8VZJ5RvZ8ud0aKh88VeqFz ql6Wzat3vguClwwaTbAuU8j8gNNgBF+Ul00psd/KyG2xqxL2TCTMd0DCVTGzePI49rrP o36DVUCZiDnO+Nb17KDUg7RbDSVvbL+F/uMS2gbYlg9558nmPCZaEzVQGYtcpouOQXNO QVzeosbgYVtNMmK613Qve1DSMH6iYHTWW7Nm51GUnnZPKlgPbmTs3Zp4gvxvYiKMWltB mpjHB9uqWfcDKJLEcWlSXY9TxvSuzCnQ0gknfdaX2UnT9yT9mZLLw08/l3qBdZwQUw+Z VpRA== 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=ETB8+V+4Gpm18tAYRLC3Fvpu7R7EaJlh09wSYLgAhZQ=; b=CLvDazYb47mDaQQT/pcryR9ZSBO/nkYr8NCjlaPo8i6f6ad2w4/THzDa/4L/rdXD0z KO4C9/lZYupS//tceQ0X6c6taR4zfIBgRT4DTBiSn1MwBTB0bTfsEA151Fl8G+HAt2kT 5WFt9KnJ8Zvw2brez/Im60hK/TMTbVAjzmUjtFqCwE4ZQmdUHN3YuLztoCWCT//kGEMG TFp+9K9/LngMc5pnBMc0//UrqWsNDL1N5KDCClX2KakbPYy7nThrIB5KqIrxTwiUgtg4 jSfKW8xpAc/Tar6a2V3MdpbH1SLY/YZXO36F/g9W1dlkTZOpsvM49OGzpCrMO8mGKgvM GJeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=PZnAJW8r; 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 33si10907771edq.187.2021.02.08.08.54.35; Mon, 08 Feb 2021 08:55:00 -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=PZnAJW8r; 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 S234696AbhBHQxA (ORCPT + 99 others); Mon, 8 Feb 2021 11:53:00 -0500 Received: from mail-db8eur05on2041.outbound.protection.outlook.com ([40.107.20.41]:54497 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233414AbhBHPRj (ORCPT ); Mon, 8 Feb 2021 10:17:39 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TKU0Dkr2OAwzcSJxYoQEedSvAurNqRMgmhJ9zGEuqOyHUrwoK8BpXINv8uCdR/o8wP3WmWeJIGmHA0lsJYGnnW16DYmPqvSXDJC5jpked/Bv+p2VZrIGiisxi42eSDVvRFyLQ2qmSrA/slLyzTyMtsc4Eb4IR4E/XezfSPml2sbISPvXAV6oAtvUlgrDsm0Gf/4qj4lzq7YN4QHT5rpSjl9liDHSTCxoj2a3LXMl+Z3u9Zd4jCnbdV1EBCvt1PcLgnC3hDdZH4Qxycw4eQdQNUNoFa7bANl0CkOmDnNP/s0dnUdfLmSRE1T2RGbpVle42UMRsLFoBGM0VEKpPchk8Q== 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=ETB8+V+4Gpm18tAYRLC3Fvpu7R7EaJlh09wSYLgAhZQ=; b=EjuIEBr92PJGzaNeotFt5aZtgDfbN2nTU8T9QPW4Hmkgqzry9RW3vefzPmcpgEWKiYEyauBvi/r0j7Na0CEK2o0E+COP7kav+NnHixVzeTudaYZcPNL/T2P56qbQRmqPGWUKbyjxTSPCPiCAa8JlvIH0roTu3Cmx1/3UcPkgKc6jqgNuo34v4IaximiuhrwWSrOVkUce1xT7/ErvVbBSH+mDv/xvWXPll1MRUgvBINpWutmwucaM6tpb6aRCzWcgom0U43g6t5xCla0FiRHh+Q7ncRFB/MVoEq0aGM4R5rionXqVkjU5f4IL3lWXQ96uDAgAbVaalsrVnKfDwTFNcw== 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=ETB8+V+4Gpm18tAYRLC3Fvpu7R7EaJlh09wSYLgAhZQ=; b=PZnAJW8rU+xiBTuxJAZ3HTHQuKBqoCxeMQpfAdYIkh3oTrP9dGqfUaudObic+LGZuDWYsuQ29Wh1upO6IwAjCmeBwaCfpUezmGQoxHtjfcwNKmBwSm6/hm1wtatLOngAdn033Y7OGROUkknfqn8Im71TK08VAHQhzQ8lbqZwQgg= 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 AM0PR04MB6435.eurprd04.prod.outlook.com (2603:10a6:208:176::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.23; Mon, 8 Feb 2021 15:14:13 +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:14:13 +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 08/15] of: mdio: Refactor of_mdiobus_register_phy() Date: Mon, 8 Feb 2021 20:42:37 +0530 Message-Id: <20210208151244.16338-9-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:14:07 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e0547086-c34c-4da5-7179-08d8cc443176 X-MS-TrafficTypeDiagnostic: AM0PR04MB6435: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZPD3075oLNeDzu7MTCCs77+aW1RpbKo/RzpgZ/74VMIYwfVBaIefeYqjw64ZCyIQ372sXKfoLJLxlvKAFZot1F1E0vHadCScCDxMbeGDcteTxuBzq9r6WZEK+4dZ8ozN1ZkpXLXtBlAxpt7v+bkn9GK6EWOH+8xraCCxZKjfZOwHWCV0pHn8hVzf3ypakXqozDy4F/BIGcahuV7d+bVZXAce1VFI3XoOoZGpoWKHs5IH8U4Xm8SOKANT/4DTJxl74VlbAR4KPYVdDE2fs+SXsh9E59zi3oBqlFiIfhDcGgmNJKM02NuKBqT+eBbeRhoQYbuu5RzlnmbGQ9TMo9rDooCxj+muq8KGiRG/39PEuMS8yEGWjqvA6QgPiyTcuvvtbjPpBeSteKkOnNcDWwIpKD7/MIscThxjFMuCDx4KOkF0gaDE4mkCKjUW3AQoOXuZb6CBIXLh2cNCdC6tNJW6j7RWvOVHSVQUczYBqRV2Fnjjc0ModZPNIaYT1gazCjhamjEdGVkTHMbunnT+Z7deo/FFaDCdvi6J7uvqAN1roJtdBwH47dH78R0BdiJxDsdbKayeHv8RfKY5f/8SKo6k/g== 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)(366004)(39860400002)(136003)(376002)(346002)(396003)(8936002)(54906003)(7416002)(52116002)(110136005)(186003)(16526019)(316002)(55236004)(956004)(6486002)(6666004)(1006002)(4326008)(2906002)(478600001)(6512007)(1076003)(6506007)(5660300002)(921005)(44832011)(83380400001)(86362001)(66556008)(26005)(2616005)(66476007)(66946007)(8676002)(110426009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?Xf2AchzxsG+mG8VofkFSrfW0Ix4/KY7MU5zb3CTA1a8Sfhy2R0v0e16g3qEK?= =?us-ascii?Q?u34eutcJ98mTZ04lCvg63Rwhv+HrCVuf/IQE+97GG3UDB4tciu4dW+S7hPly?= =?us-ascii?Q?Cun2CZaG8U8LmVS/sLx0GJLd+XfDb+vYvY3ne+9MWCI3ZUwA0u5G3ynrrLqK?= =?us-ascii?Q?PY+9CgZJ3qhB02G4FSZ8+EAEsH/jXN5mOS8Jxyo5mGa9p5uowYMftnlAIUCw?= =?us-ascii?Q?eMtMS/V3/quPTFKiuoos6rjc/L5qCvvJDnmCUIh81Hg8su6IPV4LyyKuBKIa?= =?us-ascii?Q?Ss8dBDi5MdzzfRqEsK0lmGTY4oIDj0dyCn2RAFi2THBDfOWiVzqvG2owqePf?= =?us-ascii?Q?L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XnEQ/qdKZRgmXz7TUMZxKMGE6C4/1c?= =?us-ascii?Q?nlecfS5Lc3nKDUw8MUTBex+wVejDyNpGhyZNxP06J2KbLXv9OHjqph0UK0eG?= =?us-ascii?Q?UluxukI+r6t3J2pXTZfIXIN7?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0547086-c34c-4da5-7179-08d8cc443176 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:14:13.4582 (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: plm7j+3BeUXT6bJG891A8UA7nRj8060EqkJruFpOfhgxl5bkZvnenLu1cKz2Bkoq6EyF+hW3BNM1VWzTevPo/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6435 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor of_mdiobus_register_phy() to use fwnode_mdiobus_register_phy(). 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 | 40 +------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c index cd7da38ae763..1b561849269e 100644 --- a/drivers/net/mdio/of_mdio.c +++ b/drivers/net/mdio/of_mdio.c @@ -98,45 +98,7 @@ EXPORT_SYMBOL(of_mdiobus_phy_device_register); static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *child, u32 addr) { - struct mii_timestamper *mii_ts; - struct phy_device *phy; - bool is_c45; - int rc; - u32 phy_id; - - mii_ts = of_find_mii_timestamper(child); - if (IS_ERR(mii_ts)) - return PTR_ERR(mii_ts); - - is_c45 = of_device_is_compatible(child, - "ethernet-phy-ieee802.3-c45"); - - if (!is_c45 && !of_get_phy_id(child, &phy_id)) - phy = phy_device_create(mdio, addr, phy_id, 0, NULL); - else - phy = get_phy_device(mdio, addr, is_c45); - if (IS_ERR(phy)) { - if (mii_ts) - unregister_mii_timestamper(mii_ts); - return PTR_ERR(phy); - } - - rc = of_mdiobus_phy_device_register(mdio, phy, child, addr); - if (rc) { - if (mii_ts) - unregister_mii_timestamper(mii_ts); - phy_device_free(phy); - return rc; - } - - /* 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; - - return 0; + return fwnode_mdiobus_register_phy(mdio, of_fwnode_handle(child), addr); } static int of_mdiobus_register_device(struct mii_bus *mdio, -- 2.17.1