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
e305166b
Commit
e305166b
authored
Mar 25, 2002
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ok, really add drivers/base/sys.c
parent
9294c63a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
drivers/base/sys.c
drivers/base/sys.c
+48
-0
No files found.
drivers/base/sys.c
View file @
e305166b
/*
* sys.c - pseudo-bus for system 'devices' (cpus, PICs, timers, etc)
*
* Copyright (c) 2002 Patrick Mochel
* 2002 Open Source Development Lab
*
* This exports a 'system' bus type.
* By default, a 'sys' bus gets added to the root of the system. There will
* always be core system devices. Devices can use register_sys_device() to
* add themselves as children of the system bus.
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
static
struct
device
system_bus
=
{
name:
"System Bus"
,
bus_id:
"sys"
,
};
int
register_sys_device
(
struct
device
*
dev
)
{
int
error
=
-
EINVAL
;
if
(
dev
)
{
if
(
!
dev
->
parent
)
dev
->
parent
=
&
system_bus
;
error
=
device_register
(
dev
);
}
return
error
;
}
void
unregister_sys_device
(
struct
device
*
dev
)
{
if
(
dev
)
put_device
(
dev
);
}
static
int
sys_bus_init
(
void
)
{
return
device_register
(
&
system_bus
);
}
subsys_initcall
(
sys_bus_init
);
EXPORT_SYMBOL
(
register_sys_device
);
EXPORT_SYMBOL
(
unregister_sys_device
);
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