Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\wakelock.c Create Date:2022-07-28 10:04:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:pm_wake_lock

Proto:int pm_wake_lock(const char *buf)

Type:int

Parameter:

TypeParameterName
const char *buf
208  str = buf
210  timeout_ns = 0
212  ret = 0
214  If Not Check operation authority Then Return -EPERM
217  When str && Not Note: isspace() must return false for %NUL-terminator ( * str) cycle
218  str++
220  len = str - buf
221  If Not len Then Return -EINVAL
224  If str && str != '\n' Then
226  ret = kstrtou64(skip_spaces - Removes leading whitespace from @str.*@str: The string to be stripped.* Returns a pointer to the first non-whitespace character in @str., 10, & timeout_ns)
227  If ret Then Return -EINVAL
231  mutex_lock( & wakelocks_lock)
233  wl = wakelock_lookup_add(buf, len, true)
234  If IS_ERR(wl) Then
235  ret = PTR_ERR(wl)
236  Go to out
238  If timeout_ns Then
239  timeout_ms = timeout_ns + NSEC_PER_MSEC - 1
241  do_div() is NOT a C function(timeout_ms, NSEC_PER_MSEC)
242  __pm_wakeup_event(ws, timeout_ms)
243  Else
244  __pm_stay_awake(ws)
247  wakelocks_lru_most_recent(wl)
249  out :
250  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
251  Return ret