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
0eb9b18e
Commit
0eb9b18e
authored
Feb 01, 2004
by
Jon Smirl
Committed by
Greg Kroah-Hartman
Feb 01, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Driver core: add hotplug support for class_simple
This is needed by the DRI code.
parent
b1c76c1c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
drivers/base/class_simple.c
drivers/base/class_simple.c
+18
-0
include/linux/device.h
include/linux/device.h
+2
-0
No files found.
drivers/base/class_simple.c
View file @
0eb9b18e
...
@@ -169,6 +169,24 @@ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev,
...
@@ -169,6 +169,24 @@ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev,
}
}
EXPORT_SYMBOL
(
class_simple_device_add
);
EXPORT_SYMBOL
(
class_simple_device_add
);
/**
* class_simple_set_hotplug - set the hotplug callback in the embedded struct class
* @cs: pointer to the struct class_simple to hold the pointer
* @hotplug: function pointer to the hotplug function
*
* Implement and set a hotplug function to add environment variables specific to this
* class on the hotplug event.
*/
int
class_simple_set_hotplug
(
struct
class_simple
*
cs
,
int
(
*
hotplug
)(
struct
class_device
*
dev
,
char
**
envp
,
int
num_envp
,
char
*
buffer
,
int
buffer_size
))
{
if
((
cs
==
NULL
)
||
(
IS_ERR
(
cs
)))
return
-
ENODEV
;
cs
->
class
.
hotplug
=
hotplug
;
return
0
;
}
EXPORT_SYMBOL
(
class_simple_set_hotplug
);
/**
/**
* class_simple_device_remove - removes a class device that was created with class_simple_device_add()
* class_simple_device_remove - removes a class device that was created with class_simple_device_add()
* @dev: the dev_t of the device that was previously registered.
* @dev: the dev_t of the device that was previously registered.
...
...
include/linux/device.h
View file @
0eb9b18e
...
@@ -253,6 +253,8 @@ extern struct class_simple *class_simple_create(struct module *owner, char *name
...
@@ -253,6 +253,8 @@ extern struct class_simple *class_simple_create(struct module *owner, char *name
extern
void
class_simple_destroy
(
struct
class_simple
*
cs
);
extern
void
class_simple_destroy
(
struct
class_simple
*
cs
);
extern
struct
class_device
*
class_simple_device_add
(
struct
class_simple
*
cs
,
dev_t
dev
,
struct
device
*
device
,
const
char
*
fmt
,
...)
extern
struct
class_device
*
class_simple_device_add
(
struct
class_simple
*
cs
,
dev_t
dev
,
struct
device
*
device
,
const
char
*
fmt
,
...)
__attribute__
((
format
(
printf
,
4
,
5
)));
__attribute__
((
format
(
printf
,
4
,
5
)));
extern
int
class_simple_set_hotplug
(
struct
class_simple
*
,
int
(
*
hotplug
)(
struct
class_device
*
dev
,
char
**
envp
,
int
num_envp
,
char
*
buffer
,
int
buffer_size
));
extern
void
class_simple_device_remove
(
dev_t
dev
);
extern
void
class_simple_device_remove
(
dev_t
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