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
1a900eac
Commit
1a900eac
authored
Jun 18, 2003
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
77518190
677e12b9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
18 deletions
+23
-18
Documentation/kobject.txt
Documentation/kobject.txt
+2
-9
arch/i386/kernel/time.c
arch/i386/kernel/time.c
+5
-5
drivers/base/sys.c
drivers/base/sys.c
+5
-3
include/linux/sysdev.h
include/linux/sysdev.h
+0
-1
lib/kobject.c
lib/kobject.c
+11
-0
No files found.
Documentation/kobject.txt
View file @
1a900eac
...
@@ -5,15 +5,8 @@ Patrick Mochel <mochel@osdl.org>
...
@@ -5,15 +5,8 @@ Patrick Mochel <mochel@osdl.org>
Updated: 3 June 2003
Updated: 3 June 2003
Copyright (c) Patrick Mochel
Copyright (c) 2003 Patrick Mochel
Copyright (c) Open Source Development Labs
Copyright (c) 2003 Open Source Development Labs
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
0. Introduction
0. Introduction
...
...
arch/i386/kernel/time.c
View file @
1a900eac
...
@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void)
...
@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void)
return
retval
;
return
retval
;
}
}
static
struct
sysdev_class
rtc
_sysclass
=
{
static
struct
sysdev_class
pit
_sysclass
=
{
set_kset_name
(
"
rtc
"
),
set_kset_name
(
"
pit
"
),
};
};
/* XXX this driverfs stuff should probably go elsewhere later -john */
/* XXX this driverfs stuff should probably go elsewhere later -john */
static
struct
sys_device
device_i8253
=
{
static
struct
sys_device
device_i8253
=
{
.
id
=
0
,
.
id
=
0
,
.
cls
=
&
rtc
_sysclass
,
.
cls
=
&
pit
_sysclass
,
};
};
static
int
time_init_device
(
void
)
static
int
time_init_device
(
void
)
{
{
int
error
=
sysdev_class_register
(
&
rtc
_sysclass
);
int
error
=
sysdev_class_register
(
&
pit
_sysclass
);
if
(
!
error
)
if
(
!
error
)
error
=
sys_device_register
(
&
device_i8253
);
error
=
sys_device_register
(
&
device_i8253
);
return
error
;
return
error
;
...
...
drivers/base/sys.c
View file @
1a900eac
...
@@ -74,6 +74,8 @@ void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a)
...
@@ -74,6 +74,8 @@ void sysdev_remove_file(struct sys_device * s, struct sysdev_attribute * a)
sysfs_remove_file
(
&
s
->
kobj
,
&
a
->
attr
);
sysfs_remove_file
(
&
s
->
kobj
,
&
a
->
attr
);
}
}
EXPORT_SYMBOL
(
sysdev_create_file
);
EXPORT_SYMBOL
(
sysdev_remove_file
);
/*
/*
* declare system_subsys
* declare system_subsys
...
@@ -171,6 +173,9 @@ int sys_device_register(struct sys_device * sysdev)
...
@@ -171,6 +173,9 @@ int sys_device_register(struct sys_device * sysdev)
/* Make sure the kset is set */
/* Make sure the kset is set */
sysdev
->
kobj
.
kset
=
&
cls
->
kset
;
sysdev
->
kobj
.
kset
=
&
cls
->
kset
;
/* But make sure we point to the right type for sysfs translation */
sysdev
->
kobj
.
ktype
=
&
ktype_sysdev
;
/* set the kobject name */
/* set the kobject name */
snprintf
(
sysdev
->
kobj
.
name
,
KOBJ_NAME_LEN
,
"%s%d"
,
snprintf
(
sysdev
->
kobj
.
name
,
KOBJ_NAME_LEN
,
"%s%d"
,
cls
->
kset
.
kobj
.
name
,
sysdev
->
id
);
cls
->
kset
.
kobj
.
name
,
sysdev
->
id
);
...
@@ -218,9 +223,6 @@ void sys_device_unregister(struct sys_device * sysdev)
...
@@ -218,9 +223,6 @@ void sys_device_unregister(struct sys_device * sysdev)
if
(
drv
->
remove
)
if
(
drv
->
remove
)
drv
->
remove
(
sysdev
);
drv
->
remove
(
sysdev
);
}
}
list_del_init
(
&
sysdev
->
entry
);
up_write
(
&
system_subsys
.
rwsem
);
up_write
(
&
system_subsys
.
rwsem
);
kobject_unregister
(
&
sysdev
->
kobj
);
kobject_unregister
(
&
sysdev
->
kobj
);
...
...
include/linux/sysdev.h
View file @
1a900eac
...
@@ -72,7 +72,6 @@ struct sys_device {
...
@@ -72,7 +72,6 @@ struct sys_device {
u32
id
;
u32
id
;
struct
sysdev_class
*
cls
;
struct
sysdev_class
*
cls
;
struct
kobject
kobj
;
struct
kobject
kobj
;
struct
list_head
entry
;
};
};
extern
int
sys_device_register
(
struct
sys_device
*
);
extern
int
sys_device_register
(
struct
sys_device
*
);
...
...
lib/kobject.c
View file @
1a900eac
...
@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
...
@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
#define BUFFER_SIZE 1024
/* should be enough memory for the env */
#define BUFFER_SIZE 1024
/* should be enough memory for the env */
#define NUM_ENVP 32
/* number of env pointers */
#define NUM_ENVP 32
/* number of env pointers */
static
unsigned
long
sequence_num
;
static
spinlock_t
sequence_lock
=
SPIN_LOCK_UNLOCKED
;
static
void
kset_hotplug
(
const
char
*
action
,
struct
kset
*
kset
,
static
void
kset_hotplug
(
const
char
*
action
,
struct
kset
*
kset
,
struct
kobject
*
kobj
)
struct
kobject
*
kobj
)
{
{
...
@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
...
@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
int
kobj_path_length
;
int
kobj_path_length
;
char
*
kobj_path
=
NULL
;
char
*
kobj_path
=
NULL
;
char
*
name
=
NULL
;
char
*
name
=
NULL
;
unsigned
long
seq
;
/* If the kset has a filter operation, call it. If it returns
/* If the kset has a filter operation, call it. If it returns
failure, no hotplug event is required. */
failure, no hotplug event is required. */
...
@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
...
@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
envp
[
i
++
]
=
scratch
;
envp
[
i
++
]
=
scratch
;
scratch
+=
sprintf
(
scratch
,
"ACTION=%s"
,
action
)
+
1
;
scratch
+=
sprintf
(
scratch
,
"ACTION=%s"
,
action
)
+
1
;
spin_lock
(
&
sequence_lock
);
seq
=
sequence_num
++
;
spin_unlock
(
&
sequence_lock
);
envp
[
i
++
]
=
scratch
;
scratch
+=
sprintf
(
scratch
,
"SEQNUM=%ld"
,
seq
)
+
1
;
kobj_path_length
=
get_kobj_path_length
(
kset
,
kobj
);
kobj_path_length
=
get_kobj_path_length
(
kset
,
kobj
);
kobj_path
=
kmalloc
(
kobj_path_length
,
GFP_KERNEL
);
kobj_path
=
kmalloc
(
kobj_path_length
,
GFP_KERNEL
);
if
(
!
kobj_path
)
if
(
!
kobj_path
)
...
...
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