@@ -2084,4 +2084,19 @@ static inline void *skb_put_data(struct sk_buff *skb, const void *data,
}
#endif
+#ifdef NEED_PM_RUNTIME_GET
+static inline int pm_runtime_get_if_in_use(struct device *dev)
+{
+ unsigned long flags;
+ int retval;
+
+ spin_lock_irqsave(&dev->power.lock, flags);
+ retval = dev->power.disable_depth > 0 ? -EINVAL :
+ dev->power.runtime_status == RPM_ACTIVE
+ && atomic_inc_not_zero(&dev->power.usage_count);
+ spin_unlock_irqrestore(&dev->power.lock, flags);
+ return retval;
+}
+#endif
+
#endif /* _COMPAT_H */
@@ -700,6 +700,7 @@ sub check_other_dependencies()
check_files_for_func("to_of_node", "NEED_TO_OF_NODE", "include/linux/of.h");
check_files_for_func("is_of_node", "NEED_IS_OF_NODE", "include/linux/of.h");
check_files_for_func("skb_put_data", "NEED_SKB_PUT_DATA", "include/linux/skbuff.h");
+ check_files_for_func("pm_runtime_get_if_in_use", "NEED_PM_RUNTIME_GET", "include/linux/pm_runtime.h");
# For tests for uapi-dependent logic
check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h");