Skip to content

Commit 378ce2e

Browse files
hkallweitopsiff
authored andcommitted
r8169: remove redundant hwmon support
mainline inclusion from mainline-v6.13 category: other 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: 1ffcc8d ("r8169: add support for the temperature sensor being available from RTL8125B") Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 1f691a1) Signed-off-by: Wentao Guan <[email protected]>
1 parent 4cdbeb4 commit 378ce2e

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/clk.h>
1717
#include <linux/delay.h>
1818
#include <linux/ethtool.h>
19-
#include <linux/hwmon.h>
2019
#include <linux/phy.h>
2120
#include <linux/if_vlan.h>
2221
#include <linux/in.h>
@@ -5376,43 +5375,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
53765375
return false;
53775376
}
53785377

5379-
static umode_t r8169_hwmon_is_visible(const void *drvdata,
5380-
enum hwmon_sensor_types type,
5381-
u32 attr, int channel)
5382-
{
5383-
return 0444;
5384-
}
5385-
5386-
static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
5387-
u32 attr, int channel, long *val)
5388-
{
5389-
struct rtl8169_private *tp = dev_get_drvdata(dev);
5390-
int val_raw;
5391-
5392-
val_raw = phy_read_paged(tp->phydev, 0xbd8, 0x12) & 0x3ff;
5393-
if (val_raw >= 512)
5394-
val_raw -= 1024;
5395-
5396-
*val = 1000 * val_raw / 2;
5397-
5398-
return 0;
5399-
}
5400-
5401-
static const struct hwmon_ops r8169_hwmon_ops = {
5402-
.is_visible = r8169_hwmon_is_visible,
5403-
.read = r8169_hwmon_read,
5404-
};
5405-
5406-
static const struct hwmon_channel_info * const r8169_hwmon_info[] = {
5407-
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
5408-
NULL
5409-
};
5410-
5411-
static const struct hwmon_chip_info r8169_hwmon_chip_info = {
5412-
.ops = &r8169_hwmon_ops,
5413-
.info = r8169_hwmon_info,
5414-
};
5415-
54165378
static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
54175379
{
54185380
struct rtl8169_private *tp;
@@ -5592,12 +5554,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
55925554
if (rc)
55935555
return rc;
55945556

5595-
/* The temperature sensor is available from RTl8125B */
5596-
if (IS_REACHABLE(CONFIG_HWMON) && tp->mac_version >= RTL_GIGA_MAC_VER_63)
5597-
/* ignore errors */
5598-
devm_hwmon_device_register_with_info(&pdev->dev, "nic_temp", tp,
5599-
&r8169_hwmon_chip_info,
5600-
NULL);
56015557
rc = register_netdev(dev);
56025558
if (rc)
56035559
return rc;

0 commit comments

Comments
 (0)