Commit c909e68f authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Guenter Roeck
Browse files

hwmon: (core) Use device name as a fallback in devm_hwmon_device_register_with_info



A number of network PHY drivers use the following code:

name = devm_hwmon_sanitize_name(dev, dev_name(dev));
if (IS_ERR(name))
	return PTR_ERR(name);
devm_hwmon_device_register_with_info(dev, name, ..);

Make this a generic fallback option and use the device name if no name
is provided to devm_hwmon_device_register_with_info(). This would allow
to simplify the affected drivers.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/1ebe6961-6445-4408-bfb4-b56173af9db5@gmail.com


[groeck: Update API document]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 788bd792
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment