Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp667700pxj; Thu, 10 Jun 2021 09:47:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLaK4LsLNv5tN9Xtq+vAGpAr2KhsBqpbI2eSlHrWRX+FXwof5W/2GbhmUQuo9EHmGEV0za X-Received: by 2002:aa7:c84a:: with SMTP id g10mr388407edt.326.1623343627749; Thu, 10 Jun 2021 09:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623343627; cv=none; d=google.com; s=arc-20160816; b=HOYolv40JMYNDM1U9ZgbkUMepQunBa2nxxLwquGNW7y8qUzDtqBJsp0YoxHkoUqLib Nm4fj5BpxI6IJJj6vdnXoCsvswwklMNYwizaKPFJavMGi6hFZQJNW9Jg7sbRXbmDF/Ef 1Ld2mftLMf8D/CohvvkA/N6cobGQaxbTWyHQ9UjwP0kLfJcmoHmXDAopQa9W7SHG/GGe N09+6qHiW9EI+o6Av5eD+Fkp2GTKqtWLCrN5NHl+Jx7fq2+Ub2XEAo8WCHaN+68Kzt79 KMUMZuoCrlmN4aprIQ+Zlbp+TBMUkgtwvlPWgTAVA4YNA/CP2ydle6cWw7bAzACn3ikL 0IRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GEHy85q0SvH7LpLvuhvoCSHDRdNVkwU8DE0B2plpG7c=; b=F7BR09OplbrUnE/ofomrHUZRlWcE1oU0qjkcNDGBXBAs/kKRscGKi9eFkrnz7sn9B3 wo5FfYNIgmjJIPod1SCQrJQuqSjtHjJGxe4FbDnwi3WmY4JaOZOMtrbN/yHg4RaXRz0z tJFuXBV9+Er+PXIQRHHtV1ZzeBB1wwFllWU0GEmB5CivEqHKEhf/ouodBosbp7EGi2rH rTfgQm7ZzPu7DWSpYnaPIjAZktdKBYcT+JxZjrDmlQR2HrPiLw6kb7KvMOLrmjyq7bd4 CGpuCj/+lJOaK0OvPTUSEukveHIHBEEx6JFwIeNloodGcVaFc+/No7e2KzZ8yBv/3IVu BYCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WSAtPKod; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si2955030ejo.496.2021.06.10.09.46.43; Thu, 10 Jun 2021 09:47:07 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=WSAtPKod; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbhFJQoo (ORCPT + 99 others); Thu, 10 Jun 2021 12:44:44 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:34439 "EHLO mail-ed1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230280AbhFJQn5 (ORCPT ); Thu, 10 Jun 2021 12:43:57 -0400 Received: by mail-ed1-f50.google.com with SMTP id cb9so33856002edb.1; Thu, 10 Jun 2021 09:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GEHy85q0SvH7LpLvuhvoCSHDRdNVkwU8DE0B2plpG7c=; b=WSAtPKodO4Z5ZkaBgYVJo0XDPRsYxK6DQU3oyGwYxiknYsEJO6EXFxSmAmXtKLoFWA 7NzUAvAhZqrxtSX9jO5VTlZegCJMMNP12jmANjKyTXxNQk0FN69kwgaD/3vG4NBvLeec v3SA60KAvFEizQPGyrjyfB8WWd01y57umXfQjRRgY2xc0GiR8olqpqHJMaH7qrR6NwZ7 R7o4FzhW6I51C/Z7YpcAY/y0g1uS4jgl1DWcY5jV903rg03J3MDbx/iDyALUIj2DBxji k603sVkxt834meOvbcoKzbA3Njp1KgJMbb4vpEQM3BUQ/+f8HczLwwH78xUeseoH/63y F4gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GEHy85q0SvH7LpLvuhvoCSHDRdNVkwU8DE0B2plpG7c=; b=LSvqoVHY7hAjforSu5iNZ2yaOPMZcbwzHqJs8xg6uYQ8ezjhQtnyzjw2IGZ8uGuDDb 0pJbWqnB0co6x+frlzqdiBFeCNPu94q5qr/nfJqmbuJq1kC5bcR6BaYTWVTGIqemm7EF ca8UNDe53ZsOr4dgDB2vft2HPVnEIx3xK0BLYol3RbunS7Xlmqf48S+kk3x5lyQpbMFX QAeBmMUnKeT5WjTDQlWEomB1VGQVLcuG9Q7tB7L29Onz3w5UboNAUJlaRYnH1fkjiKaN Ooobff86fsWyLXkQhH+lQzK29/qxB4zGCfwH9NYVwIrRatJDBp8NRlDN22JSk1qx1R7q QSDQ== X-Gm-Message-State: AOAM530J3faB6utOsnnaDiXjkAxLyLU8GgkCWoTmYNraW14HqJLfGap9 IKk9jilHKUzBux8omuLxg1A= X-Received: by 2002:aa7:cc87:: with SMTP id p7mr379277edt.82.1623343244520; Thu, 10 Jun 2021 09:40:44 -0700 (PDT) Received: from yoga-910.localhost ([188.26.52.84]) by smtp.gmail.com with ESMTPSA id e22sm1657166edv.57.2021.06.10.09.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Jun 2021 09:40:44 -0700 (PDT) From: Ioana Ciornei To: Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , calvin.johnson@nxp.com Cc: Cristi Sovaiala , Florin Laurentiu Chiculita , Madalin Bucur , 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 , Len Brown , "Rafael J . Wysocki" , Calvin Johnson , Ioana Ciornei Subject: [PATCH net-next v8 14/15] net: phylink: Refactor phylink_of_phy_connect() Date: Thu, 10 Jun 2021 19:39:16 +0300 Message-Id: <20210610163917.4138412-15-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610163917.4138412-1-ciorneiioana@gmail.com> References: <20210610163917.4138412-1-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Calvin Johnson Refactor phylink_of_phy_connect() to use phylink_fwnode_phy_connect(). Signed-off-by: Calvin Johnson Signed-off-by: Ioana Ciornei --- Changes in v8: None 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 9cc0f69faafe..bb9eeb74f70a 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1085,44 +1085,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.31.1