diff options
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 4df8c337221b..57849ac0384e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -26,6 +26,7 @@ #include <linux/netdevice.h> #include <linux/phy.h> #include <linux/phy_led_triggers.h> +#include <linux/pse-pd/pse.h> #include <linux/property.h> #include <linux/sfp.h> #include <linux/skbuff.h> @@ -372,7 +373,7 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, if (!fixup) return -ENOMEM; - strlcpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id)); + strscpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id)); fixup->phy_uid = phy_uid; fixup->phy_uid_mask = phy_uid_mask; fixup->run = run; @@ -522,7 +523,7 @@ phy_id_show(struct device *dev, struct device_attribute *attr, char *buf) { struct phy_device *phydev = to_phy_device(dev); - return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); + return sysfs_emit(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); } static DEVICE_ATTR_RO(phy_id); @@ -537,7 +538,7 @@ phy_interface_show(struct device *dev, struct device_attribute *attr, char *buf) else mode = phy_modes(phydev->interface); - return sprintf(buf, "%s\n", mode); + return sysfs_emit(buf, "%s\n", mode); } static DEVICE_ATTR_RO(phy_interface); @@ -547,7 +548,7 @@ phy_has_fixups_show(struct device *dev, struct device_attribute *attr, { struct phy_device *phydev = to_phy_device(dev); - return sprintf(buf, "%d\n", phydev->has_fixups); + return sysfs_emit(buf, "%d\n", phydev->has_fixups); } static DEVICE_ATTR_RO(phy_has_fixups); @@ -557,7 +558,7 @@ static ssize_t phy_dev_flags_show(struct device *dev, { struct phy_device *phydev = to_phy_device(dev); - return sprintf(buf, "0x%08x\n", phydev->dev_flags); + return sysfs_emit(buf, "0x%08x\n", phydev->dev_flags); } static DEVICE_ATTR_RO(phy_dev_flags); @@ -991,6 +992,7 @@ EXPORT_SYMBOL(phy_device_register); void phy_device_remove(struct phy_device *phydev) { unregister_mii_timestamper(phydev->mii_ts); + pse_control_put(phydev->psec); device_del(&phydev->mdio.dev); @@ -1312,7 +1314,7 @@ phy_standalone_show(struct device *dev, struct device_attribute *attr, { struct phy_device *phydev = to_phy_device(dev); - return sprintf(buf, "%d\n", !phydev->attached_dev); + return sysfs_emit(buf, "%d\n", !phydev->attached_dev); } static DEVICE_ATTR_RO(phy_standalone); |