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.

PM: wakeup: Do not expose 4 device wakeup source APIs

The following 4 APIs are only used by drivers/base/power/wakeup.c
internally.

- wakeup_source_create()
- wakeup_source_destroy()
- wakeup_source_add()
- wakeup_source_remove()

Do not expose them by making them as static functions.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20250420-fix_power-v2-1-9b938d2283aa@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zijun Hu and committed by
Greg Kroah-Hartman
142ba31d 93b27a84

+4 -23
+4 -8
drivers/base/power/wakeup.c
··· 77 77 * wakeup_source_create - Create a struct wakeup_source object. 78 78 * @name: Name of the new wakeup source. 79 79 */ 80 - struct wakeup_source *wakeup_source_create(const char *name) 80 + static struct wakeup_source *wakeup_source_create(const char *name) 81 81 { 82 82 struct wakeup_source *ws; 83 83 const char *ws_name; ··· 106 106 err_ws: 107 107 return NULL; 108 108 } 109 - EXPORT_SYMBOL_GPL(wakeup_source_create); 110 109 111 110 /* 112 111 * Record wakeup_source statistics being deleted into a dummy wakeup_source. ··· 148 149 * 149 150 * Use only for wakeup source objects created with wakeup_source_create(). 150 151 */ 151 - void wakeup_source_destroy(struct wakeup_source *ws) 152 + static void wakeup_source_destroy(struct wakeup_source *ws) 152 153 { 153 154 if (!ws) 154 155 return; ··· 157 158 wakeup_source_record(ws); 158 159 wakeup_source_free(ws); 159 160 } 160 - EXPORT_SYMBOL_GPL(wakeup_source_destroy); 161 161 162 162 /** 163 163 * wakeup_source_add - Add given object to the list of wakeup sources. 164 164 * @ws: Wakeup source object to add to the list. 165 165 */ 166 - void wakeup_source_add(struct wakeup_source *ws) 166 + static void wakeup_source_add(struct wakeup_source *ws) 167 167 { 168 168 unsigned long flags; 169 169 ··· 177 179 list_add_rcu(&ws->entry, &wakeup_sources); 178 180 raw_spin_unlock_irqrestore(&events_lock, flags); 179 181 } 180 - EXPORT_SYMBOL_GPL(wakeup_source_add); 181 182 182 183 /** 183 184 * wakeup_source_remove - Remove given object from the wakeup sources list. 184 185 * @ws: Wakeup source object to remove from the list. 185 186 */ 186 - void wakeup_source_remove(struct wakeup_source *ws) 187 + static void wakeup_source_remove(struct wakeup_source *ws) 187 188 { 188 189 unsigned long flags; 189 190 ··· 201 204 */ 202 205 ws->timer.function = NULL; 203 206 } 204 - EXPORT_SYMBOL_GPL(wakeup_source_remove); 205 207 206 208 /** 207 209 * wakeup_source_register - Create wakeup source and add it to the list.
-15
include/linux/pm_wakeup.h
··· 95 95 } 96 96 97 97 /* drivers/base/power/wakeup.c */ 98 - extern struct wakeup_source *wakeup_source_create(const char *name); 99 - extern void wakeup_source_destroy(struct wakeup_source *ws); 100 - extern void wakeup_source_add(struct wakeup_source *ws); 101 - extern void wakeup_source_remove(struct wakeup_source *ws); 102 98 extern struct wakeup_source *wakeup_source_register(struct device *dev, 103 99 const char *name); 104 100 extern void wakeup_source_unregister(struct wakeup_source *ws); ··· 124 128 { 125 129 return dev->power.can_wakeup; 126 130 } 127 - 128 - static inline struct wakeup_source *wakeup_source_create(const char *name) 129 - { 130 - return NULL; 131 - } 132 - 133 - static inline void wakeup_source_destroy(struct wakeup_source *ws) {} 134 - 135 - static inline void wakeup_source_add(struct wakeup_source *ws) {} 136 - 137 - static inline void wakeup_source_remove(struct wakeup_source *ws) {} 138 131 139 132 static inline struct wakeup_source *wakeup_source_register(struct device *dev, 140 133 const char *name)