hwmon: Deprecate [devm_]hwmon_device_register_with_groups
authorGuenter Roeck <linux@roeck-us.net>
Thu, 16 Feb 2023 19:34:19 +0000 (11:34 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 16 Feb 2023 19:34:19 +0000 (11:34 -0800)
Even though the hardware monitoring documentation already stated that new
drivers should use [devm_]devm_hwmon_device_register_with_info() to
register with the hardware monitoring subsystem, we still get submissions
for new drivers using the older APIs. There is no benefit to use those
APIs. On the contrary, using the older APIs results in substantially larger
code size. Explicitly deprecate [devm_]hwmon_device_register_with_groups()
to ensure that all new drivers use the latest API.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/submitting-patches.rst
include/linux/hwmon.h

index d953ee763c96eec4e65df39a842e21fef9ba0217..6482c4f137dcb4052a4286dc2094c2274f5a89b1 100644 (file)
@@ -126,7 +126,7 @@ increase the chances of your change being accepted.
 * Use devm_hwmon_device_register_with_info() or, if your driver needs a remove
   function, hwmon_device_register_with_info() to register your driver with the
   hwmon subsystem. Try using devm_add_action() instead of a remove function if
-  possible. Do not use hwmon_device_register().
+  possible. Do not use any of the deprecated registration functions.
 
 * Your driver should be buildable as module. If not, please be prepared to
   explain why it has to be built into the kernel.
index 14325f93c6b2bbfbe4648d18f057ac23094850b5..c1b62384b6ee71c96e3d8acd59fa4ea3e42732ad 100644 (file)
@@ -436,6 +436,10 @@ struct hwmon_chip_info {
 /* hwmon_device_register() is deprecated */
 struct device *hwmon_device_register(struct device *dev);
 
+/*
+ * hwmon_device_register_with_groups() and
+ * devm_hwmon_device_register_with_groups() are deprecated.
+ */
 struct device *
 hwmon_device_register_with_groups(struct device *dev, const char *name,
                                  void *drvdata,