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
9231a222
Commit
9231a222
authored
May 09, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] driver core: Add driver symlink to class devices in sysfs.
Thanks to Mike Anderson for the idea for this.
parent
18da5f32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
drivers/base/class.c
drivers/base/class.c
+17
-0
No files found.
drivers/base/class.c
View file @
9231a222
...
@@ -133,6 +133,21 @@ static void class_device_dev_unlink(struct class_device * class_dev)
...
@@ -133,6 +133,21 @@ static void class_device_dev_unlink(struct class_device * class_dev)
sysfs_remove_link
(
&
class_dev
->
kobj
,
"device"
);
sysfs_remove_link
(
&
class_dev
->
kobj
,
"device"
);
}
}
static
int
class_device_driver_link
(
struct
class_device
*
class_dev
)
{
if
((
class_dev
->
dev
)
&&
(
class_dev
->
dev
->
driver
))
return
sysfs_create_link
(
&
class_dev
->
kobj
,
&
class_dev
->
dev
->
driver
->
kobj
,
"driver"
);
return
0
;
}
static
void
class_device_driver_unlink
(
struct
class_device
*
class_dev
)
{
if
((
class_dev
->
dev
)
&&
(
class_dev
->
dev
->
driver
))
sysfs_remove_link
(
&
class_dev
->
kobj
,
"driver"
);
}
#define to_class_dev(obj) container_of(obj,struct class_device,kobj)
#define to_class_dev(obj) container_of(obj,struct class_device,kobj)
#define to_class_dev_attr(_attr) container_of(_attr,struct class_device_attribute,attr)
#define to_class_dev_attr(_attr) container_of(_attr,struct class_device_attribute,attr)
...
@@ -265,6 +280,7 @@ int class_device_add(struct class_device *class_dev)
...
@@ -265,6 +280,7 @@ int class_device_add(struct class_device *class_dev)
}
}
class_device_dev_link
(
class_dev
);
class_device_dev_link
(
class_dev
);
class_device_driver_link
(
class_dev
);
register_done:
register_done:
if
(
error
&&
parent
)
if
(
error
&&
parent
)
...
@@ -298,6 +314,7 @@ void class_device_del(struct class_device *class_dev)
...
@@ -298,6 +314,7 @@ void class_device_del(struct class_device *class_dev)
if
(
class_dev
->
dev
)
{
if
(
class_dev
->
dev
)
{
class_device_dev_unlink
(
class_dev
);
class_device_dev_unlink
(
class_dev
);
class_device_driver_unlink
(
class_dev
);
put_device
(
class_dev
->
dev
);
put_device
(
class_dev
->
dev
);
}
}
...
...
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