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 'devprop-fix-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull device properties framework fix from Rafael Wysocki:
"This fixes a problem with bool properties that could be seen as "true"
when the property was not present at all by adding a special helper
for bool properties with checks for all of the requisute conditions
(Sakari Ailus)"

* tag 'devprop-fix-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
device property: Introduce fwnode_call_bool_op() for ops that return bool

+7 -3
+3 -3
drivers/base/property.c
··· 253 253 { 254 254 bool ret; 255 255 256 - ret = fwnode_call_int_op(fwnode, property_present, propname); 256 + ret = fwnode_call_bool_op(fwnode, property_present, propname); 257 257 if (ret == false && !IS_ERR_OR_NULL(fwnode) && 258 258 !IS_ERR_OR_NULL(fwnode->secondary)) 259 - ret = fwnode_call_int_op(fwnode->secondary, property_present, 259 + ret = fwnode_call_bool_op(fwnode->secondary, property_present, 260 260 propname); 261 261 return ret; 262 262 } ··· 1027 1027 */ 1028 1028 bool fwnode_device_is_available(struct fwnode_handle *fwnode) 1029 1029 { 1030 - return fwnode_call_int_op(fwnode, device_is_available); 1030 + return fwnode_call_bool_op(fwnode, device_is_available); 1031 1031 } 1032 1032 EXPORT_SYMBOL_GPL(fwnode_device_is_available); 1033 1033
+4
include/linux/fwnode.h
··· 99 99 (fwnode ? (fwnode_has_op(fwnode, op) ? \ 100 100 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : -ENXIO) : \ 101 101 -EINVAL) 102 + #define fwnode_call_bool_op(fwnode, op, ...) \ 103 + (fwnode ? (fwnode_has_op(fwnode, op) ? \ 104 + (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : false) : \ 105 + false) 102 106 #define fwnode_call_ptr_op(fwnode, op, ...) \ 103 107 (fwnode_has_op(fwnode, op) ? \ 104 108 (fwnode)->ops->op(fwnode, ## __VA_ARGS__) : NULL)