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 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:
- Add missing 'name' sysfs attributes to ad7314 and ads7871 drivers
- Bump maximum wait time for applesmc driver (again)
- Fix build warning seen with W=1 in include/linux/kernel.h, introduced
with commit b6d86d3d6d6e ("Fix DIV_ROUND_CLOSEST to support negative
dividends")

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
linux/kernel.h: Fix warning seen with W=1 due to change in DIV_ROUND_CLOSEST
hwmon: (applesmc) Bump max wait
hwmon: (ad7314) Add 'name' sysfs attribute
hwmon: (ads7871) Add 'name' sysfs attribute

+20 -3
+8
drivers/hwmon/ad7314.c
··· 87 87 } 88 88 } 89 89 90 + static ssize_t ad7314_show_name(struct device *dev, 91 + struct device_attribute *devattr, char *buf) 92 + { 93 + return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); 94 + } 95 + 96 + static DEVICE_ATTR(name, S_IRUGO, ad7314_show_name, NULL); 90 97 static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, 91 98 ad7314_show_temperature, NULL, 0); 92 99 93 100 static struct attribute *ad7314_attributes[] = { 101 + &dev_attr_name.attr, 94 102 &sensor_dev_attr_temp1_input.dev_attr.attr, 95 103 NULL, 96 104 };
+9
drivers/hwmon/ads7871.c
··· 139 139 } 140 140 } 141 141 142 + static ssize_t ads7871_show_name(struct device *dev, 143 + struct device_attribute *devattr, char *buf) 144 + { 145 + return sprintf(buf, "%s\n", to_spi_device(dev)->modalias); 146 + } 147 + 142 148 static SENSOR_DEVICE_ATTR(in0_input, S_IRUGO, show_voltage, NULL, 0); 143 149 static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 1); 144 150 static SENSOR_DEVICE_ATTR(in2_input, S_IRUGO, show_voltage, NULL, 2); ··· 153 147 static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, show_voltage, NULL, 5); 154 148 static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, show_voltage, NULL, 6); 155 149 static SENSOR_DEVICE_ATTR(in7_input, S_IRUGO, show_voltage, NULL, 7); 150 + 151 + static DEVICE_ATTR(name, S_IRUGO, ads7871_show_name, NULL); 156 152 157 153 static struct attribute *ads7871_attributes[] = { 158 154 &sensor_dev_attr_in0_input.dev_attr.attr, ··· 165 157 &sensor_dev_attr_in5_input.dev_attr.attr, 166 158 &sensor_dev_attr_in6_input.dev_attr.attr, 167 159 &sensor_dev_attr_in7_input.dev_attr.attr, 160 + &dev_attr_name.attr, 168 161 NULL 169 162 }; 170 163
+2 -2
drivers/hwmon/applesmc.c
··· 53 53 54 54 #define APPLESMC_MAX_DATA_LENGTH 32 55 55 56 - /* wait up to 32 ms for a status change. */ 56 + /* wait up to 128 ms for a status change. */ 57 57 #define APPLESMC_MIN_WAIT 0x0010 58 58 #define APPLESMC_RETRY_WAIT 0x0100 59 - #define APPLESMC_MAX_WAIT 0x8000 59 + #define APPLESMC_MAX_WAIT 0x20000 60 60 61 61 #define APPLESMC_READ_CMD 0x10 62 62 #define APPLESMC_WRITE_CMD 0x11
+1 -1
include/linux/kernel.h
··· 91 91 { \ 92 92 typeof(x) __x = x; \ 93 93 typeof(divisor) __d = divisor; \ 94 - (((typeof(x))-1) >= 0 || (__x) >= 0) ? \ 94 + (((typeof(x))-1) > 0 || (__x) > 0) ? \ 95 95 (((__x) + ((__d) / 2)) / (__d)) : \ 96 96 (((__x) - ((__d) / 2)) / (__d)); \ 97 97 } \