Skip to content

Commit 91ee219

Browse files
hkallweitPaolo Abeni
authored andcommitted
net: phy: tja11xx: remove call to devm_hwmon_sanitize_name
Since c909e68 ("hwmon: (core) Use device name as a fallback in devm_hwmon_device_register_with_info") we can simply provide NULL as name argument. Note that neither priv->hwmon_name nor priv->hwmon_dev are used outside tja11xx_hwmon_register. Signed-off-by: Heiner Kallweit <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Maxime Chevallier <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 62e36b2 commit 91ee219

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

drivers/net/phy/nxp-tja11xx.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@
8787
#define TJA110X_RMII_MODE_REFCLK_IN BIT(0)
8888

8989
struct tja11xx_priv {
90-
char *hwmon_name;
91-
struct device *hwmon_dev;
9290
struct phy_device *phydev;
9391
struct work_struct phy_register_work;
9492
u32 flags;
@@ -508,19 +506,12 @@ static const struct hwmon_chip_info tja11xx_hwmon_chip_info = {
508506
static int tja11xx_hwmon_register(struct phy_device *phydev,
509507
struct tja11xx_priv *priv)
510508
{
511-
struct device *dev = &phydev->mdio.dev;
512-
513-
priv->hwmon_name = devm_hwmon_sanitize_name(dev, dev_name(dev));
514-
if (IS_ERR(priv->hwmon_name))
515-
return PTR_ERR(priv->hwmon_name);
516-
517-
priv->hwmon_dev =
518-
devm_hwmon_device_register_with_info(dev, priv->hwmon_name,
519-
phydev,
520-
&tja11xx_hwmon_chip_info,
521-
NULL);
509+
struct device *hdev, *dev = &phydev->mdio.dev;
522510

523-
return PTR_ERR_OR_ZERO(priv->hwmon_dev);
511+
hdev = devm_hwmon_device_register_with_info(dev, NULL, phydev,
512+
&tja11xx_hwmon_chip_info,
513+
NULL);
514+
return PTR_ERR_OR_ZERO(hdev);
524515
}
525516

526517
static int tja11xx_parse_dt(struct phy_device *phydev)

0 commit comments

Comments
 (0)