Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fix from Greg KH:
"Here is a single driver fix for 5.17-final that has been submitted
many times but I somehow missed it in my patch queue:

- fix for counter sysfs code for reported problem

This has been in linux-next all week with no reported issues"

* tag 'char-misc-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
counter: Stop using dev_get_drvdata() to get the counter device

+11 -6
+11 -6
drivers/counter/counter-sysfs.c
··· 19 19 20 20 #include "counter-sysfs.h" 21 21 22 + static inline struct counter_device *counter_from_dev(struct device *dev) 23 + { 24 + return container_of(dev, struct counter_device, dev); 25 + } 26 + 22 27 /** 23 28 * struct counter_attribute - Counter sysfs attribute 24 29 * @dev_attr: device attribute for sysfs ··· 95 90 struct device_attribute *attr, char *buf) 96 91 { 97 92 const struct counter_attribute *const a = to_counter_attribute(attr); 98 - struct counter_device *const counter = dev_get_drvdata(dev); 93 + struct counter_device *const counter = counter_from_dev(dev); 99 94 int err; 100 95 u8 data = 0; 101 96 ··· 127 122 const char *buf, size_t len) 128 123 { 129 124 const struct counter_attribute *const a = to_counter_attribute(attr); 130 - struct counter_device *const counter = dev_get_drvdata(dev); 125 + struct counter_device *const counter = counter_from_dev(dev); 131 126 int err; 132 127 bool bool_data = 0; 133 128 u8 data = 0; ··· 163 158 struct device_attribute *attr, char *buf) 164 159 { 165 160 const struct counter_attribute *const a = to_counter_attribute(attr); 166 - struct counter_device *const counter = dev_get_drvdata(dev); 161 + struct counter_device *const counter = counter_from_dev(dev); 167 162 const struct counter_available *const avail = a->comp.priv; 168 163 int err; 169 164 u32 data = 0; ··· 226 221 const char *buf, size_t len) 227 222 { 228 223 const struct counter_attribute *const a = to_counter_attribute(attr); 229 - struct counter_device *const counter = dev_get_drvdata(dev); 224 + struct counter_device *const counter = counter_from_dev(dev); 230 225 struct counter_count *const count = a->parent; 231 226 struct counter_synapse *const synapse = a->comp.priv; 232 227 const struct counter_available *const avail = a->comp.priv; ··· 286 281 struct device_attribute *attr, char *buf) 287 282 { 288 283 const struct counter_attribute *const a = to_counter_attribute(attr); 289 - struct counter_device *const counter = dev_get_drvdata(dev); 284 + struct counter_device *const counter = counter_from_dev(dev); 290 285 int err; 291 286 u64 data = 0; 292 287 ··· 314 309 const char *buf, size_t len) 315 310 { 316 311 const struct counter_attribute *const a = to_counter_attribute(attr); 317 - struct counter_device *const counter = dev_get_drvdata(dev); 312 + struct counter_device *const counter = counter_from_dev(dev); 318 313 int err; 319 314 u64 data = 0; 320 315