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
50c7fd6f
Commit
50c7fd6f
authored
Feb 05, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge kroah.com:/home/greg/linux/BK/bleed-2.6
into kroah.com:/home/greg/linux/BK/driver-2.6
parents
9e81ab3b
9d6cc8f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
25 deletions
+23
-25
drivers/base/class_simple.c
drivers/base/class_simple.c
+18
-0
drivers/base/core.c
drivers/base/core.c
+0
-23
include/linux/device.h
include/linux/device.h
+2
-2
lib/kobject.c
lib/kobject.c
+3
-0
No files found.
drivers/base/class_simple.c
View file @
50c7fd6f
...
...
@@ -169,6 +169,24 @@ struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev,
}
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()
* @dev: the dev_t of the device that was previously registered.
...
...
drivers/base/core.c
View file @
50c7fd6f
...
...
@@ -76,7 +76,6 @@ static struct sysfs_ops dev_sysfs_ops = {
static
void
device_release
(
struct
kobject
*
kobj
)
{
struct
device
*
dev
=
to_dev
(
kobj
);
struct
completion
*
c
=
dev
->
complete
;
if
(
dev
->
release
)
dev
->
release
(
dev
);
...
...
@@ -86,8 +85,6 @@ static void device_release(struct kobject * kobj)
dev
->
bus_id
);
WARN_ON
(
1
);
}
if
(
c
)
complete
(
c
);
}
static
struct
kobj_type
ktype_device
=
{
...
...
@@ -354,25 +351,6 @@ void device_unregister(struct device * dev)
}
/**
* device_unregister_wait - Unregister device and wait for it to be freed.
* @dev: Device to unregister.
*
* For the cases where the caller needs to wait for all references to
* be dropped from the device before continuing (e.g. modules with
* statically allocated devices), this function uses a completion struct
* to wait, along with a matching complete() in device_release() above.
*/
void
device_unregister_wait
(
struct
device
*
dev
)
{
struct
completion
c
;
init_completion
(
&
c
);
dev
->
complete
=
&
c
;
device_unregister
(
dev
);
wait_for_completion
(
&
c
);
}
/**
* device_for_each_child - device child iterator.
* @dev: parent struct device.
...
...
@@ -421,7 +399,6 @@ EXPORT_SYMBOL(device_register);
EXPORT_SYMBOL
(
device_del
);
EXPORT_SYMBOL
(
device_unregister
);
EXPORT_SYMBOL
(
device_unregister_wait
);
EXPORT_SYMBOL
(
get_device
);
EXPORT_SYMBOL
(
put_device
);
EXPORT_SYMBOL
(
device_find
);
...
...
include/linux/device.h
View file @
50c7fd6f
...
...
@@ -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
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
)));
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
);
...
...
@@ -263,7 +265,6 @@ struct device {
struct
list_head
children
;
struct
device
*
parent
;
struct
completion
*
complete
;
/* Notification for freeing device. */
struct
kobject
kobj
;
char
bus_id
[
BUS_ID_SIZE
];
/* position on parent bus */
...
...
@@ -311,7 +312,6 @@ dev_set_drvdata (struct device *dev, void *data)
*/
extern
int
device_register
(
struct
device
*
dev
);
extern
void
device_unregister
(
struct
device
*
dev
);
extern
void
device_unregister_wait
(
struct
device
*
dev
);
extern
void
device_initialize
(
struct
device
*
dev
);
extern
int
device_add
(
struct
device
*
dev
);
extern
void
device_del
(
struct
device
*
dev
);
...
...
lib/kobject.c
View file @
50c7fd6f
...
...
@@ -630,6 +630,9 @@ EXPORT_SYMBOL(kobject_register);
EXPORT_SYMBOL
(
kobject_unregister
);
EXPORT_SYMBOL
(
kobject_get
);
EXPORT_SYMBOL
(
kobject_put
);
EXPORT_SYMBOL
(
kobject_add
);
EXPORT_SYMBOL
(
kobject_del
);
EXPORT_SYMBOL
(
kobject_rename
);
EXPORT_SYMBOL
(
kobject_hotplug
);
EXPORT_SYMBOL
(
kset_register
);
...
...
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