Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a3b2c5e4
Commit
a3b2c5e4
authored
Apr 05, 2009
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dynamic-ssdt' into release
parents
49383700
4658e4ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
3 deletions
+48
-3
drivers/acpi/system.c
drivers/acpi/system.c
+48
-3
No files found.
drivers/acpi/system.c
View file @
a3b2c5e4
...
...
@@ -62,6 +62,7 @@ module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
-------------------------------------------------------------------------- */
static
LIST_HEAD
(
acpi_table_attr_list
);
static
struct
kobject
*
tables_kobj
;
static
struct
kobject
*
dynamic_tables_kobj
;
struct
acpi_table_attr
{
struct
bin_attribute
attr
;
...
...
@@ -128,6 +129,40 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
return
;
}
static
acpi_status
acpi_sysfs_table_handler
(
u32
event
,
void
*
table
,
void
*
context
)
{
struct
acpi_table_attr
*
table_attr
;
switch
(
event
)
{
case
ACPI_TABLE_EVENT_LOAD
:
table_attr
=
kzalloc
(
sizeof
(
struct
acpi_table_attr
),
GFP_KERNEL
);
if
(
!
table_attr
)
return
AE_NO_MEMORY
;
acpi_table_attr_init
(
table_attr
,
table
);
if
(
sysfs_create_bin_file
(
dynamic_tables_kobj
,
&
table_attr
->
attr
))
{
kfree
(
table_attr
);
return
AE_ERROR
;
}
else
list_add_tail
(
&
table_attr
->
node
,
&
acpi_table_attr_list
);
break
;
case
ACPI_TABLE_EVENT_UNLOAD
:
/*
* we do not need to do anything right now
* because the table is not deleted from the
* global table list when unloading it.
*/
break
;
default:
return
AE_BAD_PARAMETER
;
}
return
AE_OK
;
}
static
int
acpi_system_sysfs_init
(
void
)
{
struct
acpi_table_attr
*
table_attr
;
...
...
@@ -137,7 +172,11 @@ static int acpi_system_sysfs_init(void)
tables_kobj
=
kobject_create_and_add
(
"tables"
,
acpi_kobj
);
if
(
!
tables_kobj
)
return
-
ENOMEM
;
goto
err
;
dynamic_tables_kobj
=
kobject_create_and_add
(
"dynamic"
,
tables_kobj
);
if
(
!
dynamic_tables_kobj
)
goto
err_dynamic_tables
;
do
{
result
=
acpi_get_table_by_index
(
table_index
,
&
table_header
);
...
...
@@ -162,8 +201,14 @@ static int acpi_system_sysfs_init(void)
}
}
while
(
!
result
);
kobject_uevent
(
tables_kobj
,
KOBJ_ADD
);
kobject_uevent
(
dynamic_tables_kobj
,
KOBJ_ADD
);
result
=
acpi_install_table_handler
(
acpi_sysfs_table_handler
,
NULL
);
return
0
;
return
result
==
AE_OK
?
0
:
-
EINVAL
;
err_dynamic_tables:
kobject_put
(
tables_kobj
);
err:
return
-
ENOMEM
;
}
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment