]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jun 2022 16:22:56 +0000 (18:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jun 2022 16:22:56 +0000 (18:22 +0200)
added patches:
revert-hwmon-make-chip-parameter-for-with_info-api-mandatory.patch

queue-4.19/revert-hwmon-make-chip-parameter-for-with_info-api-mandatory.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/revert-hwmon-make-chip-parameter-for-with_info-api-mandatory.patch b/queue-4.19/revert-hwmon-make-chip-parameter-for-with_info-api-mandatory.patch
new file mode 100644 (file)
index 0000000..a1bf6ce
--- /dev/null
@@ -0,0 +1,67 @@
+From b23c09ff513d000b93062800fef22b5db6a3a381 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Thu, 23 Jun 2022 18:19:35 +0200
+Subject: Revert "hwmon: Make chip parameter for with_info API mandatory"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit 1ec0bc72f5dab3ab367ae5230cf6f212d805a225 which is
+commit ddaefa209c4ac791c1262e97c9b2d0440c8ef1d5 upstream.  It should not
+have been applied to the stable trees.
+
+Link: https://lore.kernel.org/r/20220622154454.GA1864037@roeck-us.net
+Reported-by: Julian Haller <julian.haller@philips.com>
+Reported-by: Guenter Roeck <linux@roeck-us.net>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/hwmon/hwmon-kernel-api.txt |    2 +-
+ drivers/hwmon/hwmon.c                    |   16 +++++++++-------
+ 2 files changed, 10 insertions(+), 8 deletions(-)
+
+--- a/Documentation/hwmon/hwmon-kernel-api.txt
++++ b/Documentation/hwmon/hwmon-kernel-api.txt
+@@ -71,7 +71,7 @@ hwmon_device_register_with_info is the m
+ to register a hardware monitoring device. It creates the standard sysfs
+ attributes in the hardware monitoring core, letting the driver focus on reading
+ from and writing to the chip instead of having to bother with sysfs attributes.
+-The parent device parameter as well as the chip parameter must not be NULL. Its
++The parent device parameter cannot be NULL with non-NULL chip info. Its
+ parameters are described in more detail below.
+ devm_hwmon_device_register_with_info is similar to
+--- a/drivers/hwmon/hwmon.c
++++ b/drivers/hwmon/hwmon.c
+@@ -695,12 +695,11 @@ EXPORT_SYMBOL_GPL(hwmon_device_register_
+ /**
+  * hwmon_device_register_with_info - register w/ hwmon
+- * @dev: the parent device (mandatory)
+- * @name: hwmon name attribute (mandatory)
+- * @drvdata: driver data to attach to created device (optional)
+- * @chip: pointer to hwmon chip information (mandatory)
++ * @dev: the parent device
++ * @name: hwmon name attribute
++ * @drvdata: driver data to attach to created device
++ * @chip: pointer to hwmon chip information
+  * @extra_groups: pointer to list of additional non-standard attribute groups
+- *    (optional)
+  *
+  * hwmon_device_unregister() must be called when the device is no
+  * longer needed.
+@@ -713,10 +712,13 @@ hwmon_device_register_with_info(struct d
+                               const struct hwmon_chip_info *chip,
+                               const struct attribute_group **extra_groups)
+ {
+-      if (!dev || !name || !chip)
++      if (!name)
+               return ERR_PTR(-EINVAL);
+-      if (!chip->ops || !chip->ops->is_visible || !chip->info)
++      if (chip && (!chip->ops || !chip->ops->is_visible || !chip->info))
++              return ERR_PTR(-EINVAL);
++
++      if (chip && !dev)
+               return ERR_PTR(-EINVAL);
+       return __hwmon_device_register(dev, name, drvdata, chip, extra_groups);
index edd7d0401209919c48ffb1cdd8625a325013eb59..6cc2c66f95aa56441196a1c0ce3a305fabb98a31 100644 (file)
@@ -232,3 +232,4 @@ tcp-add-small-random-increments-to-the-source-port.patch
 tcp-dynamically-allocate-the-perturb-table-used-by-source-ports.patch
 tcp-increase-source-port-perturb-table-to-2-16.patch
 tcp-drop-the-hash_32-part-from-the-index-calculation.patch
+revert-hwmon-make-chip-parameter-for-with_info-api-mandatory.patch