netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	David Miller <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, linux@roeck-us.net
Subject: Re: [PATCH net] r8169: remove redundant hwmon support
Date: Fri, 10 Jan 2025 10:17:03 +0000	[thread overview]
Message-ID: <20250110101703.GV7706@kernel.org> (raw)
In-Reply-To: <357e6526-ee3e-4e66-b556-7364fdcb2bfc@gmail.com>

+ Jean Delvare, linux-hwmon, linux@roeck-us.net

On Thu, Jan 09, 2025 at 11:29:09PM +0100, Heiner Kallweit wrote:
> The temperature sensor is actually part of the integrated PHY and available
> also on the standalone versions of the PHY. Therefore hwmon support will
> be added to the Realtek PHY driver and can be removed here.
> 
> Fixes: 1ffcc8d41306 ("r8169: add support for the temperature sensor being available from RTL8125B")
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  drivers/net/ethernet/realtek/r8169_main.c | 37 -----------------------
>  1 file changed, 37 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index 5724f650f..7b9ba91c3 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -16,7 +16,6 @@
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/ethtool.h>
> -#include <linux/hwmon.h>
>  #include <linux/phy.h>
>  #include <linux/if_vlan.h>
>  #include <linux/in.h>
> @@ -5338,36 +5337,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
>  	return false;
>  }
>  
> -static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
> -			    u32 attr, int channel, long *val)
> -{
> -	struct rtl8169_private *tp = dev_get_drvdata(dev);
> -	int val_raw;
> -
> -	val_raw = phy_read_paged(tp->phydev, 0xbd8, 0x12) & 0x3ff;
> -	if (val_raw >= 512)
> -		val_raw -= 1024;
> -
> -	*val = 1000 * val_raw / 2;
> -
> -	return 0;
> -}
> -
> -static const struct hwmon_ops r8169_hwmon_ops = {
> -	.visible = 0444,
> -	.read = r8169_hwmon_read,
> -};
> -
> -static const struct hwmon_channel_info * const r8169_hwmon_info[] = {
> -	HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
> -	NULL
> -};
> -
> -static const struct hwmon_chip_info r8169_hwmon_chip_info = {
> -	.ops = &r8169_hwmon_ops,
> -	.info = r8169_hwmon_info,
> -};
> -
>  static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  {
>  	struct rtl8169_private *tp;
> @@ -5547,12 +5516,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	if (rc)
>  		return rc;
>  
> -	/* The temperature sensor is available from RTl8125B */
> -	if (IS_REACHABLE(CONFIG_HWMON) && tp->mac_version >= RTL_GIGA_MAC_VER_63)
> -		/* ignore errors */
> -		devm_hwmon_device_register_with_info(&pdev->dev, "nic_temp", tp,
> -						     &r8169_hwmon_chip_info,
> -						     NULL);
>  	rc = register_netdev(dev);
>  	if (rc)
>  		return rc;
> -- 
> 2.47.1
> 

  reply	other threads:[~2025-01-10 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 22:29 [PATCH net] r8169: remove redundant hwmon support Heiner Kallweit
2025-01-10 10:17 ` Simon Horman [this message]
2025-01-10 16:38 ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250110101703.GV7706@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=kuba@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).