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
67d93a0a
Commit
67d93a0a
authored
Oct 15, 2002
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Plain Diff
Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
parents
9beb225e
473c7105
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
34 deletions
+21
-34
drivers/base/core.c
drivers/base/core.c
+18
-31
fs/driverfs/inode.c
fs/driverfs/inode.c
+3
-1
include/linux/driverfs_fs.h
include/linux/driverfs_fs.h
+0
-2
No files found.
drivers/base/core.c
View file @
67d93a0a
...
...
@@ -259,34 +259,22 @@ struct device * get_device(struct device * dev)
*/
void
put_device
(
struct
device
*
dev
)
{
struct
device
*
parent
;
if
(
!
atomic_dec_and_lock
(
&
dev
->
refcount
,
&
device_lock
))
return
;
parent
=
dev
->
parent
;
dev
->
parent
=
NULL
;
list_del_init
(
&
dev
->
node
);
list_del_init
(
&
dev
->
g_list
);
list_del_init
(
&
dev
->
bus_list
);
list_del_init
(
&
dev
->
driver_list
);
spin_unlock
(
&
device_lock
);
BUG_ON
(
dev
->
present
);
if
(
dev
->
release
)
dev
->
release
(
dev
);
if
(
parent
)
put_device
(
parent
);
device_del
(
dev
);
}
void
device_del
(
struct
device
*
dev
)
{
spin_lock
(
&
device_lock
);
dev
->
present
=
0
;
list_del_init
(
&
dev
->
node
);
list_del_init
(
&
dev
->
g_list
);
list_del_init
(
&
dev
->
bus_list
);
list_del_init
(
&
dev
->
driver_list
);
spin_unlock
(
&
device_lock
);
pr_debug
(
"DEV: Unregistering device. ID = '%s', name = '%s'
\n
"
,
dev
->
bus_id
,
dev
->
name
);
struct
device
*
parent
=
dev
->
parent
;
/* Notify the platform of the removal, in case they
* need to do anything...
...
...
@@ -302,6 +290,12 @@ void device_del(struct device * dev)
/* remove the driverfs directory */
device_remove_dir
(
dev
);
if
(
dev
->
release
)
dev
->
release
(
dev
);
if
(
parent
)
put_device
(
parent
);
}
/**
...
...
@@ -315,22 +309,15 @@ void device_del(struct device * dev)
*/
void
device_unregister
(
struct
device
*
dev
)
{
device_del
(
dev
);
put_device
(
dev
);
}
static
int
__init
device_init
(
void
)
{
int
error
;
spin_lock
(
&
device_lock
);
dev
->
present
=
0
;
spin_unlock
(
&
device_lock
);
error
=
init_driverfs_fs
();
if
(
error
)
panic
(
"DEV: could not initialize driverfs"
);
return
0
;
pr_debug
(
"DEV: Unregistering device. ID = '%s', name = '%s'
\n
"
,
dev
->
bus_id
,
dev
->
name
);
put_device
(
dev
);
}
core_initcall
(
device_init
);
EXPORT_SYMBOL
(
device_register
);
EXPORT_SYMBOL
(
device_unregister
);
EXPORT_SYMBOL
(
get_device
);
...
...
fs/driverfs/inode.c
View file @
67d93a0a
...
...
@@ -509,11 +509,13 @@ static void put_mount(void)
DBG
(
"driverfs: mount_count = %d
\n
"
,
mount_count
);
}
int
__init
init_driverfs_fs
(
void
)
static
int
__init
driverfs_init
(
void
)
{
return
register_filesystem
(
&
driverfs_fs_type
);
}
core_initcall
(
driverfs_init
);
static
struct
dentry
*
get_dentry
(
struct
dentry
*
parent
,
const
char
*
name
)
{
struct
qstr
qstr
;
...
...
include/linux/driverfs_fs.h
View file @
67d93a0a
...
...
@@ -65,6 +65,4 @@ driverfs_create_symlink(struct driver_dir_entry * parent,
extern
void
driverfs_remove_file
(
struct
driver_dir_entry
*
,
const
char
*
name
);
extern
int
init_driverfs_fs
(
void
);
#endif
/* _DDFS_H_ */
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