From patchwork Fri Mar 24 18:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13187176 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D217C76195 for ; Fri, 24 Mar 2023 18:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232230AbjCXSHc (ORCPT ); Fri, 24 Mar 2023 14:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232026AbjCXSHS (ORCPT ); Fri, 24 Mar 2023 14:07:18 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3990212AF for ; Fri, 24 Mar 2023 11:06:06 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id h17so2652761wrt.8 for ; Fri, 24 Mar 2023 11:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679681165; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=b80cRpolEKKWCSZ2bzobqFlHKgz1wpNhHuUs2CSAl30=; b=lCru/jm1ZwAngrixs3Hy2WK+bIcK5WHE0c099BV4LBR3NjKVpeVLI1pox9iYM7v54r WyMAOCm1INkYDODxho1TU6QPnVOo3SKjVecJy6Y+tXY9KMCYsepMgMCOaPJJggoAVgUw MEOy1MkwOqVQF1NnDXXyXrtZC84D16yoJ3Kz14KZxRvKhZWB/wgWVhSU2wFPSH1mOnV9 suuxPrqoxyyYor1IP2v4r+ZG84bGr/7cgtxf8KZ4Y0+5f9PDfrRkQtv/E/XG3nM2RwFl fkCvk2xFdhoeXH5yJdtrCkamtA+ol+40VYQ/jCFl4dLuWZI1YQu2L/F5Q455P+QcJwd5 QmyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679681165; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b80cRpolEKKWCSZ2bzobqFlHKgz1wpNhHuUs2CSAl30=; b=hhgkz11W3gV07PVH8tg2sAWjFGI8TLS/f73Y9R2QpTB0FELZEoilOtxqcI9oqqpKO6 Sjb6ZOFqsOQqPdpuA+CpBPRZ3Avgw8NohqaQyTzhO5CqJf29xrw8xxYkPSJ2YNPd6tW1 tT1FQ2E5xnkcDTnLHUb7WHdq6Y7GGpD2Mkon6IXWWxaGgnoTufSPxbYSDgCOdEx8nf1Q C2Ft2yDTWcydpgQ4pQI5zQuAmHqQHHQtf6BB24G2r/wA1x/u6EEHe6OYya6Mteq6/kaa jwT0d8S0EzHvADBjTqF6bGxJ/IIDSoTA0567SkWoIWdMJ96ADcv0lYMYW87LZ7SAxuzo mOwA== X-Gm-Message-State: AAQBX9dvATu2or6TMgXxKy+RL7PL35HDyEyWDXH/5uasRrVal8IHx5Af hLpvmqRQjnef81Advd3lPcA= X-Google-Smtp-Source: AKy350aCl49v2ztgP9utXoOttSLe84T+ngX++1cPJvdl8UBcPN+Q0Icn/DoQJMVCjg6kSgUESe97og== X-Received: by 2002:adf:f78e:0:b0:2cf:e5d7:e8d5 with SMTP id q14-20020adff78e000000b002cfe5d7e8d5mr2849328wrp.40.1679681164770; Fri, 24 Mar 2023 11:06:04 -0700 (PDT) Received: from ?IPV6:2a01:c23:b926:df00:a161:16e2:f237:a7d4? (dynamic-2a01-0c23-b926-df00-a161-16e2-f237-a7d4.c23.pool.telefonica.de. [2a01:c23:b926:df00:a161:16e2:f237:a7d4]) by smtp.googlemail.com with ESMTPSA id a18-20020a5d4d52000000b002d1e49cff35sm18830410wru.40.2023.03.24.11.06.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 11:06:04 -0700 (PDT) Message-ID: <97e1f180-ae4e-7314-a736-748bb6746d82@gmail.com> Date: Fri, 24 Mar 2023 19:03:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: [PATCH net-next 1/4] net: phylib: add getting reference clock Content-Language: en-US From: Heiner Kallweit To: Andrew Lunn , Russell King - ARM Linux , Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Florian Fainelli , Broadcom internal kernel review list Cc: "netdev@vger.kernel.org" References: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> In-Reply-To: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Few PHY drivers (smsc, bcm7xxx, micrel) get and enable the (R)MII reference clock in their probe() callback. Move this common functionality to phylib, this allows to remove it from the drivers in a follow-up. Note that we now enable the reference clock before deasserting the PHY reset signal. Maybe this even allows us to get rid of phy_reset_after_clk_enable(). Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 6 ++++++ include/linux/phy.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index c0760cbf5..6668487e2 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -3096,6 +3096,12 @@ static int phy_probe(struct device *dev) if (phydrv->flags & PHY_IS_INTERNAL) phydev->is_internal = true; + phydev->refclk = devm_clk_get_optional_enabled(dev, NULL); + if (IS_ERR(phydev->refclk)) { + err = PTR_ERR(phydev->refclk); + goto out; + } + /* Deassert the reset signal */ phy_device_reset(phydev, 0); diff --git a/include/linux/phy.h b/include/linux/phy.h index fefd5091b..6d6129674 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -11,6 +11,7 @@ #ifndef __PHY_H #define __PHY_H +#include #include #include #include @@ -595,6 +596,7 @@ struct macsec_ops; * @interface: enum phy_interface_t value * @skb: Netlink message for cable diagnostics * @nest: Netlink nest used for cable diagnostics + * @refclk: External (R)MII reference clock * @ehdr: nNtlink header for cable diagnostics * @phy_led_triggers: Array of LED triggers * @phy_num_led_triggers: Number of triggers in @phy_led_triggers @@ -719,6 +721,9 @@ struct phy_device { void *ehdr; struct nlattr *nest; + /* external (R)MII reference clock */ + struct clk *refclk; + /* Interrupt and Polling infrastructure */ struct delayed_work state_queue; From patchwork Fri Mar 24 18:03:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13187177 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA14BC76196 for ; Fri, 24 Mar 2023 18:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232505AbjCXSHe (ORCPT ); Fri, 24 Mar 2023 14:07:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbjCXSHT (ORCPT ); Fri, 24 Mar 2023 14:07:19 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 965F61F5F5 for ; Fri, 24 Mar 2023 11:06:07 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id m6-20020a05600c3b0600b003ee6e324b19so1541987wms.1 for ; Fri, 24 Mar 2023 11:06:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679681166; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Wh5z89msFtfeidRHoS+LNyTqdc6QslrKeCeDzTPeDzU=; b=pZL8Z3ftwwqniVCc92/YHrFDZoiYyTBeddis5yO/1T6XHVAmvUqIns6D4N+zKJnTxL Ur+e6yRCuQ4ru3V9Cl77qloFJny2hSdlqE2hwVRzB0TKW+tJxFUaOrh0rrGYNTNnObtV Y2DeG/hM47uFhdO1G6C/k3WUKSSG3Yx+zjMBb9wU8uqvVLmN9z1y3l/dwCb1uH0FAJrw k7prRolxVr14/bXcwNFAJvP0UwnHQKksw6ehHg2MaT0XPp+49vr4jODXANBgS0cTIypi 0CWk4GvdF9dwipg1PsFJfsMLJYQv4iLEJw2AfJ5Ibt75OjZ4aIb+5WfXdsj0cv0+TQkg 1kRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679681166; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Wh5z89msFtfeidRHoS+LNyTqdc6QslrKeCeDzTPeDzU=; b=KDQNrLEKUMA2zizcW7z09cnDrBvy6pakN4ImLdqlYbALSWSJv8j9SUR8X7KFcaYvym 7yil1uiZz1Y2p51TDR3r5hAnbpPVP/mGG/yde59+VT2cf89FUiyLAFsApG3Ry9godnao PuR1HCv9muyBgoTjWg3C06pyDDeFs2j4HfsxerTkKDQCQe8Em4pca6x78KcPCyRYV365 2cc6Lns8VOl1FTLOU4QzPNWLsypvSUWYI3RpxBpyUkc/65mQVVj5/d+d2l4TsNQ/87N8 0mvoxorJ8Ae6WyiYmAQw28dZUJmqekHb/Rbd83p5Oxt1LHvMDed5qIv//D3rYcJNwAKP dX/Q== X-Gm-Message-State: AO0yUKWtzi3jkBLeFVrwYJCKCd7By64YofBFM4LNDLJNAaxI4EjTQJ+8 I7X2nDeU09svk/4MXnKm3fY= X-Google-Smtp-Source: AK7set8d/DH9LXV1epGe+8e+AUQZHFrp5b972GYcFdI9gvV6nxA5KUfrINroQz2dVwWohoukMffJ1w== X-Received: by 2002:a05:600c:3795:b0:3ed:a82d:dffb with SMTP id o21-20020a05600c379500b003eda82ddffbmr3024309wmr.40.1679681165996; Fri, 24 Mar 2023 11:06:05 -0700 (PDT) Received: from ?IPV6:2a01:c23:b926:df00:a161:16e2:f237:a7d4? (dynamic-2a01-0c23-b926-df00-a161-16e2-f237-a7d4.c23.pool.telefonica.de. [2a01:c23:b926:df00:a161:16e2:f237:a7d4]) by smtp.googlemail.com with ESMTPSA id s3-20020a05600c45c300b003ed51cdb94csm483081wmo.26.2023.03.24.11.06.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 11:06:05 -0700 (PDT) Message-ID: <00ff6ad6-4554-2ce5-32ba-de47dcfcd81b@gmail.com> Date: Fri, 24 Mar 2023 19:03:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: [PATCH net-next 2/4] net: phy: smsc: remove getting reference clock Content-Language: en-US From: Heiner Kallweit To: Andrew Lunn , Russell King - ARM Linux , Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Florian Fainelli , Broadcom internal kernel review list Cc: "netdev@vger.kernel.org" References: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> In-Reply-To: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that getting the reference clock has been moved to phylib, we can remove it here. Signed-off-by: Heiner Kallweit --- drivers/net/phy/smsc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 730964b85..48654c684 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -278,7 +278,6 @@ int smsc_phy_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; struct smsc_phy_priv *priv; - struct clk *refclk; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -291,13 +290,7 @@ int smsc_phy_probe(struct phy_device *phydev) phydev->priv = priv; - /* Make clk optional to keep DTB backward compatibility. */ - refclk = devm_clk_get_optional_enabled(dev, NULL); - if (IS_ERR(refclk)) - return dev_err_probe(dev, PTR_ERR(refclk), - "Failed to request clock\n"); - - return clk_set_rate(refclk, 50 * 1000 * 1000); + return clk_set_rate(phydev->refclk, 50 * 1000 * 1000); } EXPORT_SYMBOL_GPL(smsc_phy_probe); From patchwork Fri Mar 24 18:04:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13187178 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8511CC76195 for ; Fri, 24 Mar 2023 18:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232272AbjCXSHg (ORCPT ); Fri, 24 Mar 2023 14:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232277AbjCXSHU (ORCPT ); Fri, 24 Mar 2023 14:07:20 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960591F49E for ; Fri, 24 Mar 2023 11:06:08 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id o32so1642993wms.1 for ; Fri, 24 Mar 2023 11:06:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679681167; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AnQAZyBTB+IURJdf5abE+JXNErsgJQIfqFPQ78I7Yvg=; b=XbEbHrMZ2e+ld5YNPhGjq3FKLqG1JdlfCA+4Zj2KlYYwkjWNfyw5TU8HOktdTZwVN4 mUs/hcgH8qla/Xq+fFtGcACVAtiltvQRY/+seM0TcwqhSZanpGIT9Op7RS3TEckcR1fK 6X6JDdooraDSho9tNElFyVn4VHgAT1q+85TMrVFfaQEWExczodPK2Prvohn7roT4M1nT oQdAmS0VUKCAl0dAWlNXyqutjgav4wcokKVyG1i1FyQcB4+9EKxxPWiJL/nBXY3cBLb/ Y8cMDLOuOosu+xBlILaVUCECGjuRPKKQdY8I/HgmBCRj+l5CebkZhjHGuXV38go2/Msj yBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679681167; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AnQAZyBTB+IURJdf5abE+JXNErsgJQIfqFPQ78I7Yvg=; b=2kHxeIJpiaUHlI3lP5JNbG+O42FbM0kqRsJozPD0qXMoXscwD4oPuIGT5LWFGJoF+n 1E0qyUJkyRxDPTWmBOq+9ZzTe7fpiVSZGFC4aoKu7lKCJ5aM0trZF3WtJbeKXrLbAVJi sYKO3iveudyeaxhg/oqlbmg/7tK/BpsObYOXWhmwimVXqkW6AGOERGdUMGSATXLvktyd 8PAJmEEybLFjWQRKZZZ0NbtcnFYrwabXRbPxkpeUOxqH5HUIb2+tSO4L6xtxLARM/47o swn+uLHdeUBMXNqNDcA0NeyvzBO5scqRGobeUk9ipR3/kCaq8ZS+SU6ERNbGPbMZmOqn iddA== X-Gm-Message-State: AO0yUKX7IKMjwgIAbJk8jJnCrqE5+p9uKJGsjuVd+LORQ7CRy3DKJtn7 J8HKWGsltqnFFoltbVJ4zq5aKdsB174= X-Google-Smtp-Source: AK7set805OM7N9+MtK90AsfiYGpSKcgKIweIYu8J/n8/FCA9JfSiyZHyYfAaBDOBXA22twUrzQ2cLg== X-Received: by 2002:a7b:c384:0:b0:3ee:5d1d:6c4e with SMTP id s4-20020a7bc384000000b003ee5d1d6c4emr3174216wmj.16.1679681167134; Fri, 24 Mar 2023 11:06:07 -0700 (PDT) Received: from ?IPV6:2a01:c23:b926:df00:a161:16e2:f237:a7d4? (dynamic-2a01-0c23-b926-df00-a161-16e2-f237-a7d4.c23.pool.telefonica.de. [2a01:c23:b926:df00:a161:16e2:f237:a7d4]) by smtp.googlemail.com with ESMTPSA id i11-20020a05600c290b00b003ee20b4b2dasm5431862wmd.46.2023.03.24.11.06.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 11:06:06 -0700 (PDT) Message-ID: Date: Fri, 24 Mar 2023 19:04:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: [PATCH net-next 3/4] net: phy: micrel: remove getting reference clock Content-Language: en-US From: Heiner Kallweit To: Andrew Lunn , Russell King - ARM Linux , Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Florian Fainelli , Broadcom internal kernel review list Cc: "netdev@vger.kernel.org" References: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> In-Reply-To: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that getting the reference clock has been moved to phylib, we can remove it here. Only one clock is supported by the PHY, therefore it's ok that we now use the first clock instead of the named one. Note that currently devm_clk_get is used instead of devm_clk_get_optional, but nevertheless the clock is treated as optional. Signed-off-by: Heiner Kallweit --- drivers/net/phy/micrel.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index e26c6723c..dfd2c1d0f 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -1884,7 +1884,6 @@ static int kszphy_probe(struct phy_device *phydev) const struct kszphy_type *type = phydev->drv->driver_data; const struct device_node *np = phydev->mdio.dev.of_node; struct kszphy_priv *priv; - struct clk *clk; priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); if (!priv) @@ -1896,10 +1895,8 @@ static int kszphy_probe(struct phy_device *phydev) kszphy_parse_led_mode(phydev); - clk = devm_clk_get(&phydev->mdio.dev, "rmii-ref"); - /* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */ - if (!IS_ERR_OR_NULL(clk)) { - unsigned long rate = clk_get_rate(clk); + if (phydev->refclk) { + unsigned long rate = clk_get_rate(phydev->refclk); bool rmii_ref_clk_sel_25_mhz; if (type) From patchwork Fri Mar 24 18:05:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13187179 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFFE9C6FD1C for ; Fri, 24 Mar 2023 18:07:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232308AbjCXSHh (ORCPT ); Fri, 24 Mar 2023 14:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjCXSHU (ORCPT ); Fri, 24 Mar 2023 14:07:20 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B5D1DBAA for ; Fri, 24 Mar 2023 11:06:09 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id m2so2665071wrh.6 for ; Fri, 24 Mar 2023 11:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679681168; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=29gzwfTDqQIKh84PweRohtsZRfLe1oRnatdEHtQFCik=; b=SqROm6enyhXsjaieRj51yDyrCY9XxQ7EW9pW5FfQSN7l3NeDD38iGgjo/ZgzEOMAqQ 800sb/9qJRE8PfvS7Za2U3esXR3E1vPf9y0uHypGzJ9GRuLGT/lwBcrC0RpmSZDDMPXn M4ZOlEk4y0mKftopKC2/aH/jhWTZNIV9+011U5Lj0n76CN5Dl5lP+trwIYPq3e1T/We2 ozZo96CVbyFgv3IbenImFYvOzvfKm1WCA0p7beBq0wIxPHWU/qV3EmAywGe6Y1T6QwSq DOBoL8DotnwfrMDBvGz9+SbzRXgcPWSFAuot1OIysEfq/mMTP62G8xgiOX+DyDx07q0h bVww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679681168; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=29gzwfTDqQIKh84PweRohtsZRfLe1oRnatdEHtQFCik=; b=eZIPZSMemptHrwDCUWsMIR3+c/nvCmqhJOTJHuGA6c0W3WuSPYEFfBh/yDvgyTBobx PFRZD8RGQ5zMaDUKa0Sh6dYxQOBG84Ow7SSUZYFSS+jtOf3deQOEj/o/Hu2sHYp7f+2K KeW508zDAvJcaLA6MZMpJNQW4UhP6lXjHOShS8acQit35xsATUIZCnoRMvjwyqZMU6qy kMTCM4FPTZis+zmbthLtUcPSe0YGL9aQfz+qhxxBFvCGIaM1byMDKj0PpkvW2tclds0p iCKhFsMzDfjfGA1x5XVoODYPUx2gtoinNZjyvNCVlFsUauLsVEyFEwbEPmv8v2/vqOzY 5+WQ== X-Gm-Message-State: AAQBX9erHcCrbwXyEYjs3ilRnNoka/UyAFvv9YhY4lVm4k14aVIVe7Lj JqGLiAIBM7VUp397U4Lp3sA= X-Google-Smtp-Source: AKy350bozDB2wiiQfZd+/UZNQia6L+kBbI01m3eJLsKL4Ly3KURz4H87lVi4xvL75MAkA1l8HE1fsg== X-Received: by 2002:adf:e30c:0:b0:2d1:5698:3f70 with SMTP id b12-20020adfe30c000000b002d156983f70mr5979056wrj.29.1679681168365; Fri, 24 Mar 2023 11:06:08 -0700 (PDT) Received: from ?IPV6:2a01:c23:b926:df00:a161:16e2:f237:a7d4? (dynamic-2a01-0c23-b926-df00-a161-16e2-f237-a7d4.c23.pool.telefonica.de. [2a01:c23:b926:df00:a161:16e2:f237:a7d4]) by smtp.googlemail.com with ESMTPSA id e11-20020a5d65cb000000b002c55de1c72bsm18847485wrw.62.2023.03.24.11.06.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 11:06:08 -0700 (PDT) Message-ID: <8d1e588f-72a4-ffff-f0f3-dbb071838a08@gmail.com> Date: Fri, 24 Mar 2023 19:05:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: [PATCH net-next 4/4] net: phy: bcm7xxx: remove getting reference clock Content-Language: en-US From: Heiner Kallweit To: Andrew Lunn , Russell King - ARM Linux , Jakub Kicinski , David Miller , Paolo Abeni , Eric Dumazet , Florian Fainelli , Broadcom internal kernel review list Cc: "netdev@vger.kernel.org" References: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> In-Reply-To: <0c529488-0fd8-19e1-c5a9-9cf1fab78ed3@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Now that getting the reference clock has been moved to phylib, we can remove it here. Signed-off-by: Heiner Kallweit --- drivers/net/phy/bcm7xxx.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 75593e7d1..c608e0439 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c @@ -11,7 +11,6 @@ #include "bcm-phy-lib.h" #include #include -#include #include /* Broadcom BCM7xxx internal PHY registers */ @@ -45,7 +44,6 @@ struct bcm7xxx_phy_priv { u64 *stats; - struct clk *clk; }; static int bcm7xxx_28nm_d0_afe_config_init(struct phy_device *phydev) @@ -825,14 +823,6 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev) if (!priv->stats) return -ENOMEM; - priv->clk = devm_clk_get_optional(&phydev->mdio.dev, NULL); - if (IS_ERR(priv->clk)) - return PTR_ERR(priv->clk); - - ret = clk_prepare_enable(priv->clk); - if (ret) - return ret; - /* Dummy read to a register to workaround an issue upon reset where the * internal inverter may not allow the first MDIO transaction to pass * the MDIO management controller and make us return 0xffff for such @@ -844,13 +834,6 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev) return ret; } -static void bcm7xxx_28nm_remove(struct phy_device *phydev) -{ - struct bcm7xxx_phy_priv *priv = phydev->priv; - - clk_disable_unprepare(priv->clk); -} - #define BCM7XXX_28NM_GPHY(_oui, _name) \ { \ .phy_id = (_oui), \ @@ -866,7 +849,6 @@ static void bcm7xxx_28nm_remove(struct phy_device *phydev) .get_strings = bcm_phy_get_strings, \ .get_stats = bcm7xxx_28nm_get_phy_stats, \ .probe = bcm7xxx_28nm_probe, \ - .remove = bcm7xxx_28nm_remove, \ } #define BCM7XXX_28NM_EPHY(_oui, _name) \ @@ -882,7 +864,6 @@ static void bcm7xxx_28nm_remove(struct phy_device *phydev) .get_strings = bcm_phy_get_strings, \ .get_stats = bcm7xxx_28nm_get_phy_stats, \ .probe = bcm7xxx_28nm_probe, \ - .remove = bcm7xxx_28nm_remove, \ .read_mmd = bcm7xxx_28nm_ephy_read_mmd, \ .write_mmd = bcm7xxx_28nm_ephy_write_mmd, \ } @@ -908,7 +889,6 @@ static void bcm7xxx_28nm_remove(struct phy_device *phydev) /* PHY_BASIC_FEATURES */ \ .flags = PHY_IS_INTERNAL, \ .probe = bcm7xxx_28nm_probe, \ - .remove = bcm7xxx_28nm_remove, \ .config_init = bcm7xxx_16nm_ephy_config_init, \ .config_aneg = genphy_config_aneg, \ .read_status = genphy_read_status, \