|
| 1 | +--- a/include/linux/device/class.h |
| 2 | ++++ b/include/linux/device/class.h |
| 3 | +@@ -51,6 +51,7 @@ |
| 4 | + */ |
| 5 | + struct class { |
| 6 | + const char *name; |
| 7 | ++ struct module *owner; |
| 8 | + |
| 9 | + const struct attribute_group **class_groups; |
| 10 | + const struct attribute_group **dev_groups; |
| 11 | +--- a/include/linux/prandom.h |
| 12 | ++++ b/include/linux/prandom.h |
| 13 | +@@ -24,6 +24,12 @@ |
| 14 | + #define prandom_init_once(pcpu_state) \ |
| 15 | + DO_ONCE(prandom_seed_full_state, (pcpu_state)) |
| 16 | + |
| 17 | ++/* Deprecated: use get_random_u32_below() instead. */ |
| 18 | ++static inline u32 prandom_u32_max(u32 ep_ro) |
| 19 | ++{ |
| 20 | ++ return get_random_u32_below(ep_ro); |
| 21 | ++} |
| 22 | ++ |
| 23 | + /* |
| 24 | + * Handle minimum values for seeds |
| 25 | + */ |
| 26 | +--- a/include/linux/u64_stats_sync.h |
| 27 | ++++ b/include/linux/u64_stats_sync.h |
| 28 | +@@ -213,4 +213,16 @@ |
| 29 | + return __u64_stats_fetch_retry(syncp, start); |
| 30 | + } |
| 31 | + |
| 32 | ++/* Obsolete interfaces */ |
| 33 | ++static inline unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp) |
| 34 | ++{ |
| 35 | ++ return u64_stats_fetch_begin(syncp); |
| 36 | ++} |
| 37 | ++ |
| 38 | ++static inline bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp, |
| 39 | ++ unsigned int start) |
| 40 | ++{ |
| 41 | ++ return u64_stats_fetch_retry(syncp, start); |
| 42 | ++} |
| 43 | ++ |
| 44 | + #endif /* _LINUX_U64_STATS_SYNC_H */ |
| 45 | +--- a/drivers/thermal/thermal_core.c |
| 46 | ++++ b/drivers/thermal/thermal_core.c |
| 47 | +@@ -1270,7 +1270,7 @@ |
| 48 | + return ERR_PTR(-EINVAL); |
| 49 | + } |
| 50 | + |
| 51 | +- if (num_trips > 0 && !trips) |
| 52 | ++ if (num_trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp) && !trips) |
| 53 | + return ERR_PTR(-EINVAL); |
| 54 | + |
| 55 | + if (!thermal_class) |
| 56 | +@@ -1392,6 +1392,17 @@ |
| 57 | + return ERR_PTR(result); |
| 58 | + } |
| 59 | + EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); |
| 60 | ++ |
| 61 | ++struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask, |
| 62 | ++ void *devdata, struct thermal_zone_device_ops *ops, |
| 63 | ++ const struct thermal_zone_params *tzp, int passive_delay, |
| 64 | ++ int polling_delay) |
| 65 | ++{ |
| 66 | ++ return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask, |
| 67 | ++ devdata, ops, tzp, |
| 68 | ++ passive_delay, polling_delay); |
| 69 | ++} |
| 70 | ++EXPORT_SYMBOL_GPL(thermal_zone_device_register); |
| 71 | + |
| 72 | + struct thermal_zone_device *thermal_tripless_zone_device_register( |
| 73 | + const char *type, |
| 74 | +--- a/drivers/thermal/thermal_trip.c |
| 75 | ++++ b/drivers/thermal/thermal_trip.c |
| 76 | +@@ -116,11 +116,29 @@ |
| 77 | + int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id, |
| 78 | + struct thermal_trip *trip) |
| 79 | + { |
| 80 | +- if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip) |
| 81 | ++ int ret; |
| 82 | ++ |
| 83 | ++ if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip) |
| 84 | + return -EINVAL; |
| 85 | + |
| 86 | +- *trip = tz->trips[trip_id]; |
| 87 | +- return 0; |
| 88 | ++ if (tz->trips) { |
| 89 | ++ *trip = tz->trips[trip_id]; |
| 90 | ++ return 0; |
| 91 | ++ } |
| 92 | ++ |
| 93 | ++ if (tz->ops->get_trip_hyst) { |
| 94 | ++ ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis); |
| 95 | ++ if (ret) |
| 96 | ++ return ret; |
| 97 | ++ } else { |
| 98 | ++ trip->hysteresis = 0; |
| 99 | ++ } |
| 100 | ++ |
| 101 | ++ ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature); |
| 102 | ++ if (ret) |
| 103 | ++ return ret; |
| 104 | ++ |
| 105 | ++ return tz->ops->get_trip_type(tz, trip_id, &trip->type); |
| 106 | + } |
| 107 | + EXPORT_SYMBOL_GPL(__thermal_zone_get_trip); |
| 108 | + |
| 109 | +--- a/include/linux/thermal.h |
| 110 | ++++ b/include/linux/thermal.h |
| 111 | +@@ -76,7 +76,11 @@ |
| 112 | + int (*set_trips) (struct thermal_zone_device *, int, int); |
| 113 | + int (*change_mode) (struct thermal_zone_device *, |
| 114 | + enum thermal_device_mode); |
| 115 | ++ int (*get_trip_type) (struct thermal_zone_device *, int, |
| 116 | ++ enum thermal_trip_type *); |
| 117 | ++ int (*get_trip_temp) (struct thermal_zone_device *, int, int *); |
| 118 | + int (*set_trip_temp) (struct thermal_zone_device *, int, int); |
| 119 | ++ int (*get_trip_hyst) (struct thermal_zone_device *, int, int *); |
| 120 | + int (*set_trip_hyst) (struct thermal_zone_device *, int, int); |
| 121 | + int (*get_crit_temp) (struct thermal_zone_device *, int *); |
| 122 | + int (*set_emul_temp) (struct thermal_zone_device *, int); |
| 123 | +@@ -300,6 +304,14 @@ |
| 124 | + #endif |
| 125 | + |
| 126 | + #ifdef CONFIG_THERMAL |
| 127 | ++struct thermal_zone_device *thermal_zone_device_register( |
| 128 | ++ const char *type, |
| 129 | ++ int num_trips, int mask, |
| 130 | ++ void *devdata, |
| 131 | ++ struct thermal_zone_device_ops *ops, |
| 132 | ++ const struct thermal_zone_params *tzp, |
| 133 | ++ int passive_delay, int polling_delay); |
| 134 | ++ |
| 135 | + struct thermal_zone_device *thermal_zone_device_register_with_trips( |
| 136 | + const char *type, |
| 137 | + struct thermal_trip *trips, |
| 138 | +@@ -356,6 +368,15 @@ |
| 139 | + int thermal_zone_device_disable(struct thermal_zone_device *tz); |
| 140 | + void thermal_zone_device_critical(struct thermal_zone_device *tz); |
| 141 | + #else |
| 142 | ++static inline struct thermal_zone_device *thermal_zone_device_register( |
| 143 | ++ const char *type, |
| 144 | ++ int num_trips, int mask, |
| 145 | ++ void *devdata, |
| 146 | ++ struct thermal_zone_device_ops *ops, |
| 147 | ++ const struct thermal_zone_params *tzp, |
| 148 | ++ int passive_delay, int polling_delay) |
| 149 | ++{ return ERR_PTR(-ENODEV); } |
| 150 | ++ |
| 151 | + static inline struct thermal_zone_device *thermal_zone_device_register_with_trips( |
| 152 | + const char *type, |
| 153 | + struct thermal_trip *trips, |
0 commit comments