Skip to content

Commit 1f691a1

Browse files
hkallweitkuba-moo
authored andcommitted
r8169: remove redundant hwmon support
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]>
1 parent 9e2bbab commit 1f691a1

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>
@@ -5347,43 +5346,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
53475346
return false;
53485347
}
53495348

5350-
static umode_t r8169_hwmon_is_visible(const void *drvdata,
5351-
enum hwmon_sensor_types type,
5352-
u32 attr, int channel)
5353-
{
5354-
return 0444;
5355-
}
5356-
5357-
static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
5358-
u32 attr, int channel, long *val)
5359-
{
5360-
struct rtl8169_private *tp = dev_get_drvdata(dev);
5361-
int val_raw;
5362-
5363-
val_raw = phy_read_paged(tp->phydev, 0xbd8, 0x12) & 0x3ff;
5364-
if (val_raw >= 512)
5365-
val_raw -= 1024;
5366-
5367-
*val = 1000 * val_raw / 2;
5368-
5369-
return 0;
5370-
}
5371-
5372-
static const struct hwmon_ops r8169_hwmon_ops = {
5373-
.is_visible = r8169_hwmon_is_visible,
5374-
.read = r8169_hwmon_read,
5375-
};
5376-
5377-
static const struct hwmon_channel_info * const r8169_hwmon_info[] = {
5378-
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
5379-
NULL
5380-
};
5381-
5382-
static const struct hwmon_chip_info r8169_hwmon_chip_info = {
5383-
.ops = &r8169_hwmon_ops,
5384-
.info = r8169_hwmon_info,
5385-
};
5386-
53875349
static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
53885350
{
53895351
struct rtl8169_private *tp;
@@ -5563,12 +5525,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
55635525
if (rc)
55645526
return rc;
55655527

5566-
/* The temperature sensor is available from RTl8125B */
5567-
if (IS_REACHABLE(CONFIG_HWMON) && tp->mac_version >= RTL_GIGA_MAC_VER_63)
5568-
/* ignore errors */
5569-
devm_hwmon_device_register_with_info(&pdev->dev, "nic_temp", tp,
5570-
&r8169_hwmon_chip_info,
5571-
NULL);
55725528
rc = register_netdev(dev);
55735529
if (rc)
55745530
return rc;

0 commit comments

Comments
 (0)