History

hwmon: Remove devm_hwmon_device_unregister() API function

devm_hwmon_device_unregister() has no in-tree user, and its implementation is wrong since it does not pass the to-be-removed hardware monitoring device as parameter. I do not envision a valid use for it; drivers needing it should not have called devm_hwmon_device_register_with_info() in the first place. Remove it.

Guenter Roeck committed 2 years ago

Commit 2cb4acf1 parent 3017d283 files · +0 −26Browse files

Unified · Split

3 files
  1. Documentation/hwmon/hwmon-kernel-api.rst +0 −7
  2. drivers/hwmon/hwmon.c +0 −18
  3. include/linux/hwmon.h +0 −1
Documentation/hwmon/hwmon-kernel-api.rst+0−7
@@ -38,8 +38,6 @@ register/unregister functions:: · 37 unmodified lines
3838
3939 void hwmon_device_unregister(struct device *dev);
4040
41− void devm_hwmon_device_unregister(struct device *dev);
42−
4341 char *hwmon_sanitize_name(const char *name);
4442
4543 char *devm_hwmon_sanitize_name(struct device *dev, const char *name);
@@ -64,11 +62,6 @@ monitoring device structure. This function must be called from the driver · 18 unmodified lines
6462 remove function if the hardware monitoring device was registered with
6563 hwmon_device_register_with_info.
6664
67−devm_hwmon_device_unregister does not normally have to be called. It is only
68−needed for error handling, and only needed if the driver probe fails after
69−the call to devm_hwmon_device_register_with_info and if the automatic (device
70−managed) removal would be too late.
71−
7265 All supported hwmon device registration functions only accept valid device
7366 names. Device names including invalid characters (whitespace, '*', or '-')
7467 will be rejected. The 'name' parameter is mandatory.
drivers/hwmon/hwmon.c+0−18
@@ -1188,24 +1188,6 @@ error: · 1187 unmodified lines
11881188 }
11891189 EXPORT_SYMBOL_GPL(devm_hwmon_device_register_with_info);
11901190
1191−static int devm_hwmon_match(struct device *dev, void *res, void *data)
1192−{
1193− struct device **hwdev = res;
1194−
1195− return *hwdev == data;
1196−}
1197−
1198−/**
1199− * devm_hwmon_device_unregister - removes a previously registered hwmon device
1200− *
1201− * @dev: the parent device of the device to unregister
1202− */
1203−void devm_hwmon_device_unregister(struct device *dev)
1204−{
1205− WARN_ON(devres_release(dev, devm_hwmon_release, devm_hwmon_match, dev));
1206−}
1207−EXPORT_SYMBOL_GPL(devm_hwmon_device_unregister);
1208−
12091191 static char *__hwmon_sanitize_name(struct device *dev, const char *old_name)
12101192 {
12111193 char *name, *p;
include/linux/hwmon.h+0−1
@@ -481,7 +481,6 @@ devm_hwmon_device_register_with_info(struct device *dev, · 480 unmodified lines
481481 const struct attribute_group **extra_groups);
482482
483483 void hwmon_device_unregister(struct device *dev);
484−void devm_hwmon_device_unregister(struct device *dev);
485484
486485 int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type,
487486 u32 attr, int channel);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t