Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:state_store

Proto:static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)

Type:ssize_t

Parameter:

TypeParameterName
struct kobject *kobj
struct kobj_attribute *attr
const char *buf
size_tn
605  error = pm_autosleep_lock()
606  If error Then Return error
609  If pm_autosleep_state() > PM_SUSPEND_ON Then
610  error = -EBUSY
611  Go to out
614  state = decode_state(buf, n)
615  If state < PM_SUSPEND_MAX Then
616  If state == PM_SUSPEND_MEM Then state = mem_sleep_current
619  error = pm_suspend(state)
620  Else if state == PM_SUSPEND_MAX Then
621  error = hibernate()
622  Else
623  error = -EINVAL
626  out :
627  pm_autosleep_unlock()
628  Return If error Then error Else n