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
nexedi
linux
Commits
5faee7a3
Commit
5faee7a3
authored
Apr 27, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
My cleanups to the smbios driver.
parent
d2d64066
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
31 deletions
+13
-31
drivers/firmware/smbios.c
drivers/firmware/smbios.c
+13
-31
No files found.
drivers/firmware/smbios.c
View file @
5faee7a3
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
* This code takes information provided by SMBIOS tables
* This code takes information provided by SMBIOS tables
* and presents it in sysfs as:
* and presents it in sysfs as:
* /sys/firmware/smbios
/smbios
* /sys/firmware/smbios
* |--> /table_entry_point
* |--> /table_entry_point
* |--> /table
* |--> /table
*
*
...
@@ -42,7 +42,6 @@ MODULE_LICENSE("GPL");
...
@@ -42,7 +42,6 @@ MODULE_LICENSE("GPL");
struct
smbios_device
{
struct
smbios_device
{
struct
smbios_table_entry_point
table_eps
;
struct
smbios_table_entry_point
table_eps
;
unsigned
int
smbios_table_real_length
;
unsigned
int
smbios_table_real_length
;
struct
kobject
kobj
;
};
};
/* there shall be only one */
/* there shall be only one */
...
@@ -143,7 +142,7 @@ static ssize_t
...
@@ -143,7 +142,7 @@ static ssize_t
smbios_read_table_entry_point
(
struct
kobject
*
kobj
,
char
*
buffer
,
smbios_read_table_entry_point
(
struct
kobject
*
kobj
,
char
*
buffer
,
loff_t
pos
,
size_t
size
)
loff_t
pos
,
size_t
size
)
{
{
struct
smbios_device
*
sdev
=
to_smbios_device
(
kobj
)
;
struct
smbios_device
*
sdev
=
&
the_smbios_device
;
const
char
*
p
=
(
const
char
*
)
&
(
sdev
->
table_eps
);
const
char
*
p
=
(
const
char
*
)
&
(
sdev
->
table_eps
);
unsigned
int
count
=
unsigned
int
count
=
size
>
sizeof
(
sdev
->
table_eps
)
?
size
>
sizeof
(
sdev
->
table_eps
)
?
...
@@ -156,7 +155,7 @@ static ssize_t
...
@@ -156,7 +155,7 @@ static ssize_t
smbios_read_table
(
struct
kobject
*
kobj
,
char
*
buffer
,
smbios_read_table
(
struct
kobject
*
kobj
,
char
*
buffer
,
loff_t
pos
,
size_t
size
)
loff_t
pos
,
size_t
size
)
{
{
struct
smbios_device
*
sdev
=
to_smbios_device
(
kobj
)
;
struct
smbios_device
*
sdev
=
&
the_smbios_device
;
u8
*
buf
;
u8
*
buf
;
unsigned
int
count
=
sdev
->
smbios_table_real_length
-
pos
;
unsigned
int
count
=
sdev
->
smbios_table_real_length
-
pos
;
int
i
=
0
;
int
i
=
0
;
...
@@ -204,30 +203,16 @@ static struct kobj_type ktype_smbios = {
...
@@ -204,30 +203,16 @@ static struct kobj_type ktype_smbios = {
static
decl_subsys
(
smbios
,
&
ktype_smbios
,
NULL
);
static
decl_subsys
(
smbios
,
&
ktype_smbios
,
NULL
);
static
inline
void
static
void
smbios_device_unregister
(
void
)
smbios_device_unregister
(
struct
smbios_device
*
sdev
)
{
{
sysfs_remove_bin_file
(
&
sdev
->
kobj
,
&
tep_attr
);
sysfs_remove_bin_file
(
&
smbios_subsys
.
kset
.
kobj
,
&
tep_attr
);
sysfs_remove_bin_file
(
&
sdev
->
kobj
,
&
table_attr
);
sysfs_remove_bin_file
(
&
smbios_subsys
.
kset
.
kobj
,
&
table_attr
);
kobject_unregister
(
&
sdev
->
kobj
);
}
}
static
int
static
void
__init
smbios_device_register
(
void
)
smbios_device_register
(
struct
smbios_device
*
sdev
)
{
{
int
error
;
sysfs_create_bin_file
(
&
smbios_subsys
.
kset
.
kobj
,
&
tep_attr
);
sysfs_create_bin_file
(
&
smbios_subsys
.
kset
.
kobj
,
&
table_attr
);
if
(
!
sdev
)
return
1
;
kobject_set_name
(
&
sdev
->
kobj
,
"smbios"
);
kobj_set_kset_s
(
sdev
,
smbios_subsys
);
error
=
kobject_register
(
&
sdev
->
kobj
);
if
(
!
error
){
sysfs_create_bin_file
(
&
sdev
->
kobj
,
&
tep_attr
);
sysfs_create_bin_file
(
&
sdev
->
kobj
,
&
table_attr
);
}
return
error
;
}
}
static
int
__init
static
int
__init
...
@@ -247,10 +232,7 @@ smbios_init(void)
...
@@ -247,10 +232,7 @@ smbios_init(void)
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
rc
=
smbios_device_register
(
&
the_smbios_device
);
smbios_device_register
();
if
(
rc
)
firmware_unregister
(
&
smbios_subsys
);
return
rc
;
return
rc
;
}
}
...
@@ -258,7 +240,7 @@ smbios_init(void)
...
@@ -258,7 +240,7 @@ smbios_init(void)
static
void
__exit
static
void
__exit
smbios_exit
(
void
)
smbios_exit
(
void
)
{
{
smbios_device_unregister
(
&
the_smbios_device
);
smbios_device_unregister
();
firmware_unregister
(
&
smbios_subsys
);
firmware_unregister
(
&
smbios_subsys
);
}
}
...
...
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