Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp105855pxf; Wed, 10 Mar 2021 22:24:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf2sWFuMuZx5PDYMRVvWhiSXewUpKYr4j+l7ODF8jt7HDrZHyLplapJp9IDnD/V1pt8GOy X-Received: by 2002:a50:cc4a:: with SMTP id n10mr6977125edi.371.1615443886539; Wed, 10 Mar 2021 22:24:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1615443886; cv=pass; d=google.com; s=arc-20160816; b=lufIgu5odCzbM44OmdwvZVrWz/Z+z/+U0x9fdMtnLxpqlpKQ5D6+Lnc39SAv/Y4PxH 6ZlkrswAJrsNiLkYSMi+W+M0UGg3g8MqAArkJQw5wp9Ew/47zEJVolyLBefOwsf1aQAA 0PiJYjULUzyHkwGIHgW7+jlti2E+gZR2MyhtMhZltlAZv+VHGIdbVtnHCNq16+/blTkG r1NTVfw77F+gWiaLIQIPOCCq5gt7ncIyWENU7NXS93tt2TJDSRuKtP7+OuxAylDs/ukt HeajmohYoBIlPgiY1bKJlOdo7tw7Pn+di37tS9NqgJzQlXycZyRxXol6iBTfbn5uZFD0 3BFQ== 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=j7SN/BUqBAwlVBwCfUUBNaCGolKQ5r3lhz3ovvjZzX4=; b=hJ2S1ILqPbK51rg/xiRXlBMN0k1yDYQdEk0klEyQBpZuifMgTSUxkqPdRLOBy0hpJl AV/U0I1O9kJNf1XmvHmOJ1FCZXTKNACO1fxfptuPbXTZd5ADJVxUTaJ7ludBoDD1EdjB NRAFfh118Wx8uWltOa7yFNufZ6FilOVRRj27x4vSLHLoQHdJ+71fW21IWRT8LNJC5KL/ J/gE4uJwwWicqDlImCFwuPqlsc3mjoJ7N3i7dDaneDzqmsd3/vtlhHBaf87cAVKcd5Ty HkHIXXY6lIyAL8I3U3/ixsE7zoqaszLWlk0R7mOvvWbeM1G/nrMUMCcUgKN6eFrdLSy2 Gckw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=lpEii64k; 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 n5si1111147eji.285.2021.03.10.22.24.23; Wed, 10 Mar 2021 22:24:46 -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=lpEii64k; 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 S230048AbhCKGXU (ORCPT + 99 others); Thu, 11 Mar 2021 01:23:20 -0500 Received: from mail-eopbgr20082.outbound.protection.outlook.com ([40.107.2.82]:36174 "EHLO EUR02-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231617AbhCKGXB (ORCPT ); Thu, 11 Mar 2021 01:23:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i54lwoEgzMD+1NVQ+cJso1uOa7ewEG45bjBTh4Sh5WoUSWZJctzfcu7Dao+TbUhcEi80qcV7b/09YHl7809YLwVqkt46N1AWWOlljrz4Apdun9uOdoJvmZp+YTvhTVEFVI4JZZCOvpq4tv9F593Fi8qaNejEwVDIrIYEU+/WPLWcs4Nf7/WlvRw8NZ9nE/3pvJiLmCyj0wTQ0yJWaNjBtVf/9dCnbPVhMvQMmCyIOj68XouwFxElGtgP+Ouq+PvvKsaL7tY0fuctVFJ1on9s2//Z8Qsok7TXE39qrpgphzDVo143U0P4/ht7r23Wlig544wONKQFYBdZe/WprpuuOg== 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=j7SN/BUqBAwlVBwCfUUBNaCGolKQ5r3lhz3ovvjZzX4=; b=jytBh1biAmfOYcuL16vTFtN+B6KnPyVUSmS7RTkb794Y1UjaSA1Xwe1shocGyvzG2QWMPjn/m2P9zQ5ZKb77DdGrdjx5CMpQLbkOELr+mxfXZeLSyJoebmIMuUZqFojow8FS8UhHYxQHAfngFawzpcTmE5PFb2fPYfNfZAwbaRwpdZLPn6Urq2X6FmKzu192zexsS0sPZbs9KRtGjNtJWyQ9YAcYF6igbOP5HZtsumWhHiUHX1NdRVTH3oi9HZeENzDA7N0+UmCVuqWiRXZKUrp4c26S/uNiecV6BUkxcGn8C+JHAMZXoGcAGKG9aMX5+8ilVrxo8ks1Ars3J+RBAg== 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=j7SN/BUqBAwlVBwCfUUBNaCGolKQ5r3lhz3ovvjZzX4=; b=lpEii64k19K/Yx4KKHY3U9HPganetcobnJGDqQnQjlwRKpMfN5uGYquOo1Vv/TdVYiiD/iWucyHLK6oeJpZ6onuBo4mXdqHEwmD+h/mUj6tKt4UIoRBYl7FVD94lxk2wndFwx22gQeSoIPfqj+L+hefSWr9ErbmM7IPd+odf3fM= 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:22:58 +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:22:58 +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 15/16] net: phylink: Refactor phylink_of_phy_connect() Date: Thu, 11 Mar 2021 11:50:10 +0530 Message-Id: <20210311062011.8054-16-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:22:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0dbe97bd-b4de-4518-17b2-08d8e4561d11 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:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bmqrx5P/bX8EvYENr7SB0hGx6pfRSwAxNmVXA1lbA6dfdDq2dIsA8TedGZ50mo2agj60sNSqrRbh/5rTK7ld4ZZRboVhY1YMBVFCuXC2jyTK7bWyHoDtfreAbTtEud6c/xt/U0Uyx471rcbs2k391Npy9A+FBmAY3kfo15Vqfb0KUg6J6zhPH5KcR3Ab1LVAwFYQ8FSVHxR2tOkaGKZCYsosklZloIHqVE/mmG7T5GKsEsUO3Llk7FKmRNID8snMfgm+iseHJXdl065dBmwy2geTDEzerFQD3obX2mFDj58xi+mY00ZECVRrW/JLOp4u3Kh7xktiJAMXZpuZCeQUBfm/nEerIj+dmJVbUsnkCkZQhzbl68vzMvQWOpydDnaqtypvFsH9VWToCYK8zFLm9i7bpSj08T9HZK8aq16gP1Mon7NQOW82Sxf28N51gKMjTvTknS6bPywdCLHFe0JWshhwmN6N4qFoUMHo++eKz/efrr8cc6aaGnBqinIn+KA9UepKLpJQLyN7mF5JzHAYF6x18Lxa0TuLzcsgXko87KgO8KeHiXKrJIjxf7wWRVj/WVahEfKHESuDMXLGVh//Dw== 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?p47z3aLYbeTyC8gzslFz7KGpTaJ792nXyAXkPF1ljyMYxM3gR3Y95gUlROhR?= =?us-ascii?Q?tPaC8EDvek1ZLYO5JNr1SVfVBQJMERM0TEUvYxtenFLFkYzaIw2F3GOCF57T?= =?us-ascii?Q?81m+AMxdjg3WM5TfKSpxU3jOQcHxoNOhao1cyjsWELPVz79Pee7ubFr11e2L?= =?us-ascii?Q?K6fCldOpiAxK/Ik3jez6pdSFY656iSGPpvkEEt5hOIFrC2lM4h6d74/JLUid?= =?us-ascii?Q?D6PpfjwBFgosDHSlYQpuEOcrwM8unsK2DwWyn43p7UVWt9+p7z5S2/sH+hAo?= =?us-ascii?Q?NdnBYG2a3gMjvZwUBG8bZh9sMg1ojU8QgG+r2a2i8jy+/C6+KmwpHxLhRFlt?= =?us-ascii?Q?MqNFtaC2wutpJgpYBg2gg7Eus+1Lk7UjQ2SBUW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4vBJ8YzWGA8QgSuI0YJF7EPpZcezOwMakA3vorhGteeEVJE7vIFO1z3?= =?us-ascii?Q?vljU1gtnYqk3PnaEE7Xp68IF?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0dbe97bd-b4de-4518-17b2-08d8e4561d11 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:22:58.1273 (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: odbnNfMVhlbFGoXuNZqM24PONPzfORyTA7AHfxgVcoDTve8tWcldaWvjEcu9xpuhUuNL2gQ3Ljp9wCBhqvqxmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6611 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor phylink_of_phy_connect() to use phylink_fwnode_phy_connect(). 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/phy/phylink.c | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 23753f92e0a6..ce7e918430c8 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1084,44 +1084,7 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy); int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn, u32 flags) { - struct device_node *phy_node; - struct phy_device *phy_dev; - int ret; - - /* Fixed links and 802.3z are handled without needing a PHY */ - if (pl->cfg_link_an_mode == MLO_AN_FIXED || - (pl->cfg_link_an_mode == MLO_AN_INBAND && - phy_interface_mode_is_8023z(pl->link_interface))) - return 0; - - phy_node = of_parse_phandle(dn, "phy-handle", 0); - if (!phy_node) - phy_node = of_parse_phandle(dn, "phy", 0); - if (!phy_node) - phy_node = of_parse_phandle(dn, "phy-device", 0); - - if (!phy_node) { - if (pl->cfg_link_an_mode == MLO_AN_PHY) - return -ENODEV; - return 0; - } - - phy_dev = of_phy_find_device(phy_node); - /* We're done with the phy_node handle */ - of_node_put(phy_node); - if (!phy_dev) - return -ENODEV; - - ret = phy_attach_direct(pl->netdev, phy_dev, flags, - pl->link_interface); - if (ret) - return ret; - - ret = phylink_bringup_phy(pl, phy_dev, pl->link_config.interface); - if (ret) - phy_detach(phy_dev); - - return ret; + return phylink_fwnode_phy_connect(pl, of_fwnode_handle(dn), flags); } EXPORT_SYMBOL_GPL(phylink_of_phy_connect); -- 2.17.1