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
28d7baf8
Commit
28d7baf8
authored
Jan 17, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Plain Diff
Merge samba.org:/scratch/anton/linux-2.5
into samba.org:/scratch/anton/for-alan
parents
c5ae7458
4edfd8c3
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
76 additions
and
108 deletions
+76
-108
Documentation/driver-model/bus.txt
Documentation/driver-model/bus.txt
+2
-2
Documentation/driver-model/driver.txt
Documentation/driver-model/driver.txt
+16
-16
Documentation/driver-model/overview.txt
Documentation/driver-model/overview.txt
+2
-2
Documentation/filesystems/sysfs.txt
Documentation/filesystems/sysfs.txt
+2
-8
drivers/base/bus.c
drivers/base/bus.c
+14
-22
drivers/base/node.c
drivers/base/node.c
+2
-2
drivers/block/elevator.c
drivers/block/elevator.c
+5
-3
drivers/s390/cio/chsc.c
drivers/s390/cio/chsc.c
+4
-4
drivers/s390/net/ctcmain.c
drivers/s390/net/ctcmain.c
+3
-7
drivers/s390/net/cu3088.c
drivers/s390/net/cu3088.c
+1
-5
drivers/s390/net/netiucv.c
drivers/s390/net/netiucv.c
+2
-2
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_debug.c
+19
-33
include/linux/kobject.h
include/linux/kobject.h
+1
-1
lib/kobject.c
lib/kobject.c
+3
-1
No files found.
Documentation/driver-model/bus.txt
View file @
28d7baf8
...
@@ -32,8 +32,8 @@ object of this type. They must initialize the name field, and may
...
@@ -32,8 +32,8 @@ object of this type. They must initialize the name field, and may
optionally initialize the match callback.
optionally initialize the match callback.
struct bus_type pci_bus_type = {
struct bus_type pci_bus_type = {
name:
"pci",
.name =
"pci",
match:
pci_bus_match,
.match =
pci_bus_match,
};
};
The structure should be exported to drivers in a header file:
The structure should be exported to drivers in a header file:
...
...
Documentation/driver-model/driver.txt
View file @
28d7baf8
...
@@ -49,14 +49,14 @@ driver. This declaration is hypothetical only; it relies on the driver
...
@@ -49,14 +49,14 @@ driver. This declaration is hypothetical only; it relies on the driver
being converted completely to the new model.
being converted completely to the new model.
static struct device_driver eepro100_driver = {
static struct device_driver eepro100_driver = {
name:
"eepro100",
.name =
"eepro100",
bus:
&pci_bus_type,
.bus =
&pci_bus_type,
devclass:
ðernet_devclass, /* when it's implemented */
.devclass =
ðernet_devclass, /* when it's implemented */
probe:
eepro100_probe,
.probe =
eepro100_probe,
remove:
eepro100_remove,
.remove =
eepro100_remove,
suspend:
eepro100_suspend,
.suspend =
eepro100_suspend,
resume:
eepro100_resume,
.resume =
eepro100_resume,
};
};
Most drivers will not be able to be converted completely to the new
Most drivers will not be able to be converted completely to the new
...
@@ -81,15 +81,15 @@ A definition that included bus-specific fields would look something
...
@@ -81,15 +81,15 @@ A definition that included bus-specific fields would look something
like (using the eepro100 driver again):
like (using the eepro100 driver again):
static struct pci_driver eepro100_driver = {
static struct pci_driver eepro100_driver = {
id_table:
eepro100_pci_tbl,
.id_table =
eepro100_pci_tbl,
driver:
{
.driver =
{
name:
"eepro100",
.name =
"eepro100",
bus:
&pci_bus_type,
.bus =
&pci_bus_type,
devclass:
ðernet_devclass, /* when it's implemented */
.devclass =
ðernet_devclass, /* when it's implemented */
probe:
eepro100_probe,
.probe =
eepro100_probe,
remove:
eepro100_remove,
.remove =
eepro100_remove,
suspend:
eepro100_suspend,
.suspend =
eepro100_suspend,
resume:
eepro100_resume,
.resume =
eepro100_resume,
},
},
};
};
...
...
Documentation/driver-model/overview.txt
View file @
28d7baf8
...
@@ -86,11 +86,11 @@ whole sysfs filesystem anywhere in userspace.
...
@@ -86,11 +86,11 @@ whole sysfs filesystem anywhere in userspace.
This can be done permanently by providing the following entry into the
This can be done permanently by providing the following entry into the
/etc/fstab (under the provision that the mount point does exist, of course):
/etc/fstab (under the provision that the mount point does exist, of course):
none /
device
s sysfs defaults 0 0
none /
sy
s sysfs defaults 0 0
Or by hand on the command line:
Or by hand on the command line:
~: mount -t sysfs none
/devices
# mount -t sysfs sysfs
/devices
Whenever a device is inserted into the tree, a directory is created for it.
Whenever a device is inserted into the tree, a directory is created for it.
This directory may be populated at each layer of discovery - the global layer,
This directory may be populated at each layer of discovery - the global layer,
...
...
Documentation/filesystems/sysfs.txt
View file @
28d7baf8
...
@@ -6,12 +6,6 @@ Patrick Mochel <mochel@osdl.org>
...
@@ -6,12 +6,6 @@ Patrick Mochel <mochel@osdl.org>
10 January 2003
10 January 2003
Note (17 Oct 2002): the name has just been changed from sysfs to
sysfs. Updates to the documentation will come soon; after the
conversion to use it is completely finished.
What it is:
What it is:
~~~~~~~~~~~
~~~~~~~~~~~
...
@@ -271,8 +265,8 @@ for devices on that particular bus (this assmumes that drivers do not
...
@@ -271,8 +265,8 @@ for devices on that particular bus (this assmumes that drivers do not
span multiple bus types).
span multiple bus types).
More information can d
evice
-model specific features can be found in
More information can d
river
-model specific features can be found in
Documentation/d
evice
-model/.
Documentation/d
river
-model/.
TODO: Finish this section.
TODO: Finish this section.
...
...
drivers/base/bus.c
View file @
28d7baf8
...
@@ -282,26 +282,23 @@ static int bus_match(struct device * dev, struct device_driver * drv)
...
@@ -282,26 +282,23 @@ static int bus_match(struct device * dev, struct device_driver * drv)
* Walk the list of drivers that the bus has and call bus_match()
* Walk the list of drivers that the bus has and call bus_match()
* for each pair. If a compatible pair is found, break out and return.
* for each pair. If a compatible pair is found, break out and return.
*/
*/
static
int
device_attach
(
struct
device
*
dev
)
static
void
device_attach
(
struct
device
*
dev
)
{
{
struct
bus_type
*
bus
=
dev
->
bus
;
struct
bus_type
*
bus
=
dev
->
bus
;
struct
list_head
*
entry
;
struct
list_head
*
entry
;
int
error
=
0
;
if
(
dev
->
driver
)
{
if
(
dev
->
driver
)
{
device_bind_driver
(
dev
);
device_bind_driver
(
dev
);
return
0
;
return
;
}
}
if
(
!
bus
->
match
)
if
(
bus
->
match
)
{
return
0
;
list_for_each
(
entry
,
&
bus
->
drivers
.
list
)
{
struct
device_driver
*
drv
=
to_drv
(
entry
);
list_for_each
(
entry
,
&
bus
->
drivers
.
list
)
{
if
(
!
bus_match
(
dev
,
drv
))
struct
device_driver
*
drv
=
to_drv
(
entry
);
break
;
if
(
!
(
error
=
bus_match
(
dev
,
drv
)))
}
break
;
}
}
return
error
;
}
}
...
@@ -318,22 +315,21 @@ static int device_attach(struct device * dev)
...
@@ -318,22 +315,21 @@ static int device_attach(struct device * dev)
* Note that we ignore the error from bus_match(), since it's perfectly
* Note that we ignore the error from bus_match(), since it's perfectly
* valid for a driver not to bind to any devices.
* valid for a driver not to bind to any devices.
*/
*/
static
int
driver_attach
(
struct
device_driver
*
drv
)
static
void
driver_attach
(
struct
device_driver
*
drv
)
{
{
struct
bus_type
*
bus
=
drv
->
bus
;
struct
bus_type
*
bus
=
drv
->
bus
;
struct
list_head
*
entry
;
struct
list_head
*
entry
;
if
(
!
bus
->
match
)
if
(
!
bus
->
match
)
return
0
;
return
;
list_for_each
(
entry
,
&
bus
->
devices
.
list
)
{
list_for_each
(
entry
,
&
bus
->
devices
.
list
)
{
struct
device
*
dev
=
container_of
(
entry
,
struct
device
,
bus_list
);
struct
device
*
dev
=
container_of
(
entry
,
struct
device
,
bus_list
);
if
(
!
dev
->
driver
)
{
if
(
!
dev
->
driver
)
{
if
(
!
bus_match
(
dev
,
drv
)
&&
dev
->
driver
)
if
(
!
bus_match
(
dev
,
drv
))
devclass_add_device
(
dev
);
devclass_add_device
(
dev
);
}
}
}
}
return
0
;
}
}
...
@@ -393,8 +389,7 @@ int bus_add_device(struct device * dev)
...
@@ -393,8 +389,7 @@ int bus_add_device(struct device * dev)
down_write
(
&
dev
->
bus
->
subsys
.
rwsem
);
down_write
(
&
dev
->
bus
->
subsys
.
rwsem
);
pr_debug
(
"bus %s: add device %s
\n
"
,
bus
->
name
,
dev
->
bus_id
);
pr_debug
(
"bus %s: add device %s
\n
"
,
bus
->
name
,
dev
->
bus_id
);
list_add_tail
(
&
dev
->
bus_list
,
&
dev
->
bus
->
devices
.
list
);
list_add_tail
(
&
dev
->
bus_list
,
&
dev
->
bus
->
devices
.
list
);
if
((
error
=
device_attach
(
dev
)))
device_attach
(
dev
);
list_del_init
(
&
dev
->
bus_list
);
up_write
(
&
dev
->
bus
->
subsys
.
rwsem
);
up_write
(
&
dev
->
bus
->
subsys
.
rwsem
);
sysfs_create_link
(
&
bus
->
devices
.
kobj
,
&
dev
->
kobj
,
dev
->
bus_id
);
sysfs_create_link
(
&
bus
->
devices
.
kobj
,
&
dev
->
kobj
,
dev
->
bus_id
);
}
}
...
@@ -446,11 +441,8 @@ int bus_add_driver(struct device_driver * drv)
...
@@ -446,11 +441,8 @@ int bus_add_driver(struct device_driver * drv)
}
}
down_write
(
&
bus
->
subsys
.
rwsem
);
down_write
(
&
bus
->
subsys
.
rwsem
);
if
(
!
(
error
=
devclass_add_driver
(
drv
)))
{
if
(
!
(
error
=
devclass_add_driver
(
drv
)))
if
((
error
=
driver_attach
(
drv
)))
{
driver_attach
(
drv
);
devclass_remove_driver
(
drv
);
}
}
up_write
(
&
bus
->
subsys
.
rwsem
);
up_write
(
&
bus
->
subsys
.
rwsem
);
if
(
error
)
{
if
(
error
)
{
...
...
drivers/base/node.c
View file @
28d7baf8
...
@@ -28,10 +28,10 @@ struct device_driver node_driver = {
...
@@ -28,10 +28,10 @@ struct device_driver node_driver = {
};
};
static
ssize_t
node_read_cpumap
(
struct
device
*
dev
,
char
*
buf
,
size_t
count
,
loff_t
off
)
static
ssize_t
node_read_cpumap
(
struct
device
*
dev
,
char
*
buf
)
{
{
struct
node
*
node_dev
=
to_node
(
to_root
(
dev
));
struct
node
*
node_dev
=
to_node
(
to_root
(
dev
));
return
off
?
0
:
sprintf
(
buf
,
"%lx
\n
"
,
node_dev
->
cpumap
);
return
sprintf
(
buf
,
"%lx
\n
"
,
node_dev
->
cpumap
);
}
}
static
DEVICE_ATTR
(
cpumap
,
S_IRUGO
,
node_read_cpumap
,
NULL
);
static
DEVICE_ATTR
(
cpumap
,
S_IRUGO
,
node_read_cpumap
,
NULL
);
...
...
drivers/block/elevator.c
View file @
28d7baf8
...
@@ -431,10 +431,12 @@ int elv_register_queue(struct gendisk *disk)
...
@@ -431,10 +431,12 @@ int elv_register_queue(struct gendisk *disk)
void
elv_unregister_queue
(
struct
gendisk
*
disk
)
void
elv_unregister_queue
(
struct
gendisk
*
disk
)
{
{
request_queue_t
*
q
=
disk
->
queue
;
request_queue_t
*
q
=
disk
->
queue
;
elevator_t
*
e
=
&
q
->
elevator
;
kobject_unregister
(
&
e
->
kobj
);
if
(
q
)
{
kobject_put
(
&
disk
->
kobj
);
elevator_t
*
e
=
&
q
->
elevator
;
kobject_unregister
(
&
e
->
kobj
);
kobject_put
(
&
disk
->
kobj
);
}
}
}
elevator_t
elevator_noop
=
{
elevator_t
elevator_noop
=
{
...
...
drivers/s390/cio/chsc.c
View file @
28d7baf8
...
@@ -616,13 +616,13 @@ chp_status_show(struct device *dev, char *buf)
...
@@ -616,13 +616,13 @@ chp_status_show(struct device *dev, char *buf)
switch
(
chp
->
state
)
{
switch
(
chp
->
state
)
{
case
CHP_OFFLINE
:
case
CHP_OFFLINE
:
return
s
nprintf
(
buf
,
count
,
"n/a
\n
"
);
return
s
printf
(
buf
,
"n/a
\n
"
);
case
CHP_LOGICALLY_OFFLINE
:
case
CHP_LOGICALLY_OFFLINE
:
return
s
nprintf
(
buf
,
count
,
"logically offline
\n
"
);
return
s
printf
(
buf
,
"logically offline
\n
"
);
case
CHP_STANDBY
:
case
CHP_STANDBY
:
return
s
nprintf
(
buf
,
count
,
"n/a
\n
"
);
return
s
printf
(
buf
,
"n/a
\n
"
);
case
CHP_ONLINE
:
case
CHP_ONLINE
:
return
s
nprintf
(
buf
,
count
,
"online
\n
"
);
return
s
printf
(
buf
,
"online
\n
"
);
default:
default:
return
0
;
return
0
;
}
}
...
...
drivers/s390/net/ctcmain.c
View file @
28d7baf8
...
@@ -2762,27 +2762,23 @@ ctc_init_netdevice(struct net_device * dev, int alloc_device,
...
@@ -2762,27 +2762,23 @@ ctc_init_netdevice(struct net_device * dev, int alloc_device,
}
}
static
ssize_t
static
ssize_t
ctc_proto_show
(
struct
device
*
dev
,
char
*
buf
,
size_t
count
,
loff_t
off
)
ctc_proto_show
(
struct
device
*
dev
,
char
*
buf
)
{
{
struct
ctc_priv
*
priv
;
struct
ctc_priv
*
priv
;
if
(
off
)
return
0
;
priv
=
dev
->
driver_data
;
priv
=
dev
->
driver_data
;
if
(
!
priv
)
if
(
!
priv
)
return
-
ENODEV
;
return
-
ENODEV
;
return
s
nprintf
(
buf
,
count
,
"%d
\n
"
,
priv
->
protocol
);
return
s
printf
(
buf
,
"%d
\n
"
,
priv
->
protocol
);
}
}
static
ssize_t
static
ssize_t
ctc_proto_store
(
struct
device
*
dev
,
const
char
*
buf
,
size_t
count
,
loff_t
off
)
ctc_proto_store
(
struct
device
*
dev
,
const
char
*
buf
,
size_t
count
)
{
{
struct
ctc_priv
*
priv
;
struct
ctc_priv
*
priv
;
int
value
;
int
value
;
if
(
off
)
return
0
;
priv
=
dev
->
driver_data
;
priv
=
dev
->
driver_data
;
if
(
!
priv
)
if
(
!
priv
)
return
-
ENODEV
;
return
-
ENODEV
;
...
...
drivers/s390/net/cu3088.c
View file @
28d7baf8
...
@@ -63,8 +63,7 @@ struct device cu3088_root_dev = {
...
@@ -63,8 +63,7 @@ struct device cu3088_root_dev = {
};
};
static
ssize_t
static
ssize_t
group_write
(
struct
device_driver
*
drv
,
const
char
*
buf
,
size_t
count
,
group_write
(
struct
device_driver
*
drv
,
const
char
*
buf
,
size_t
count
)
loff_t
off
)
{
{
const
char
*
start
,
*
end
;
const
char
*
start
,
*
end
;
char
bus_ids
[
2
][
BUS_ID_SIZE
],
*
argv
[
2
];
char
bus_ids
[
2
][
BUS_ID_SIZE
],
*
argv
[
2
];
...
@@ -72,9 +71,6 @@ group_write(struct device_driver *drv, const char *buf, size_t count,
...
@@ -72,9 +71,6 @@ group_write(struct device_driver *drv, const char *buf, size_t count,
int
ret
;
int
ret
;
struct
ccwgroup_driver
*
cdrv
;
struct
ccwgroup_driver
*
cdrv
;
if
(
off
)
return
0
;
cdrv
=
to_ccwgroupdrv
(
drv
);
cdrv
=
to_ccwgroupdrv
(
drv
);
if
(
!
cdrv
)
if
(
!
cdrv
)
return
-
EINVAL
;
return
-
EINVAL
;
...
...
drivers/s390/net/netiucv.c
View file @
28d7baf8
...
@@ -1473,11 +1473,11 @@ txtime_show (struct device *dev, char *buf)
...
@@ -1473,11 +1473,11 @@ txtime_show (struct device *dev, char *buf)
{
{
netiucv_priv
*
priv
=
dev
->
driver_data
;
netiucv_priv
*
priv
=
dev
->
driver_data
;
return
s
nprintf
(
buf
,
count
,
"%ld
\n
"
,
priv
->
conn
->
prof
.
tx_time
);
return
s
printf
(
buf
,
"%ld
\n
"
,
priv
->
conn
->
prof
.
tx_time
);
}
}
static
ssize_t
static
ssize_t
txtime_write
(
struct
device
*
dev
,
const
char
*
buf
)
txtime_write
(
struct
device
*
dev
,
const
char
*
buf
,
size_t
count
)
{
{
netiucv_priv
*
priv
=
dev
->
driver_data
;
netiucv_priv
*
priv
=
dev
->
driver_data
;
...
...
drivers/scsi/scsi_debug.c
View file @
28d7baf8
...
@@ -1192,20 +1192,17 @@ static int scsi_debug_proc_info(char *buffer, char **start, off_t offset,
...
@@ -1192,20 +1192,17 @@ static int scsi_debug_proc_info(char *buffer, char **start, off_t offset,
return
len
;
return
len
;
}
}
static
ssize_t
sdebug_delay_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_delay_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_delay
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_delay
);
}
}
static
ssize_t
sdebug_delay_write
(
struct
device_driver
*
ddp
,
static
ssize_t
sdebug_delay_write
(
struct
device_driver
*
ddp
,
const
char
*
buf
,
size_t
count
,
loff_t
off
)
const
char
*
buf
,
size_t
count
)
{
{
int
delay
;
int
delay
;
char
work
[
20
];
char
work
[
20
];
if
(
off
)
return
0
;
if
(
1
==
sscanf
(
buf
,
"%10s"
,
work
))
{
if
(
1
==
sscanf
(
buf
,
"%10s"
,
work
))
{
if
((
1
==
sscanf
(
work
,
"%d"
,
&
delay
))
&&
(
delay
>=
0
))
{
if
((
1
==
sscanf
(
work
,
"%d"
,
&
delay
))
&&
(
delay
>=
0
))
{
scsi_debug_delay
=
delay
;
scsi_debug_delay
=
delay
;
...
@@ -1217,20 +1214,17 @@ static ssize_t sdebug_delay_write(struct device_driver * ddp,
...
@@ -1217,20 +1214,17 @@ static ssize_t sdebug_delay_write(struct device_driver * ddp,
DRIVER_ATTR
(
delay
,
S_IRUGO
|
S_IWUSR
,
sdebug_delay_read
,
DRIVER_ATTR
(
delay
,
S_IRUGO
|
S_IWUSR
,
sdebug_delay_read
,
sdebug_delay_write
)
sdebug_delay_write
)
static
ssize_t
sdebug_opts_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_opts_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"0x%x
\n
"
,
scsi_debug_opts
);
return
sprintf
(
buf
,
"0x%x
\n
"
,
scsi_debug_opts
);
}
}
static
ssize_t
sdebug_opts_write
(
struct
device_driver
*
ddp
,
static
ssize_t
sdebug_opts_write
(
struct
device_driver
*
ddp
,
const
char
*
buf
,
size_t
count
,
loff_t
off
)
const
char
*
buf
,
size_t
count
)
{
{
int
opts
;
int
opts
;
char
work
[
20
];
char
work
[
20
];
if
(
off
)
return
0
;
if
(
1
==
sscanf
(
buf
,
"%10s"
,
work
))
{
if
(
1
==
sscanf
(
buf
,
"%10s"
,
work
))
{
if
(
0
==
strnicmp
(
work
,
"0x"
,
2
))
{
if
(
0
==
strnicmp
(
work
,
"0x"
,
2
))
{
if
(
1
==
sscanf
(
&
work
[
2
],
"%x"
,
&
opts
))
if
(
1
==
sscanf
(
&
work
[
2
],
"%x"
,
&
opts
))
...
@@ -1248,55 +1242,47 @@ static ssize_t sdebug_opts_write(struct device_driver * ddp,
...
@@ -1248,55 +1242,47 @@ static ssize_t sdebug_opts_write(struct device_driver * ddp,
DRIVER_ATTR
(
opts
,
S_IRUGO
|
S_IWUSR
,
sdebug_opts_read
,
DRIVER_ATTR
(
opts
,
S_IRUGO
|
S_IWUSR
,
sdebug_opts_read
,
sdebug_opts_write
)
sdebug_opts_write
)
static
ssize_t
sdebug_num_devs_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_num_devs_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_num_devs
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_num_devs
);
}
}
DRIVER_ATTR
(
num_devs
,
S_IRUGO
,
sdebug_num_devs_read
,
NULL
)
DRIVER_ATTR
(
num_devs
,
S_IRUGO
,
sdebug_num_devs_read
,
NULL
)
static
ssize_t
sdebug_dev_size_mb_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_dev_size_mb_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_dev_size_mb
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_dev_size_mb
);
}
}
DRIVER_ATTR
(
dev_size_mb
,
S_IRUGO
,
sdebug_dev_size_mb_read
,
NULL
)
DRIVER_ATTR
(
dev_size_mb
,
S_IRUGO
,
sdebug_dev_size_mb_read
,
NULL
)
static
ssize_t
sdebug_every_nth_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_every_nth_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_every_nth
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_every_nth
);
}
}
DRIVER_ATTR
(
every_nth
,
S_IRUGO
,
sdebug_every_nth_read
,
NULL
)
DRIVER_ATTR
(
every_nth
,
S_IRUGO
,
sdebug_every_nth_read
,
NULL
)
static
ssize_t
sdebug_max_luns_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_max_luns_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_max_luns
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_max_luns
);
}
}
DRIVER_ATTR
(
max_luns
,
S_IRUGO
,
sdebug_max_luns_read
,
NULL
)
DRIVER_ATTR
(
max_luns
,
S_IRUGO
,
sdebug_max_luns_read
,
NULL
)
static
ssize_t
sdebug_scsi_level_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_scsi_level_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_scsi_level
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_scsi_level
);
}
}
DRIVER_ATTR
(
scsi_level
,
S_IRUGO
,
sdebug_scsi_level_read
,
NULL
)
DRIVER_ATTR
(
scsi_level
,
S_IRUGO
,
sdebug_scsi_level_read
,
NULL
)
static
ssize_t
sdebug_add_host_read
(
struct
device_driver
*
ddp
,
char
*
buf
,
static
ssize_t
sdebug_add_host_read
(
struct
device_driver
*
ddp
,
char
*
buf
)
size_t
count
,
loff_t
off
)
{
{
return
off
?
0
:
snprintf
(
buf
,
count
,
"%d
\n
"
,
scsi_debug_add_host
);
return
sprintf
(
buf
,
"%d
\n
"
,
scsi_debug_add_host
);
}
}
static
ssize_t
sdebug_add_host_write
(
struct
device_driver
*
ddp
,
static
ssize_t
sdebug_add_host_write
(
struct
device_driver
*
ddp
,
const
char
*
buf
,
size_t
count
,
loff_t
off
)
const
char
*
buf
,
size_t
count
)
{
{
int
delta_hosts
,
k
;
int
delta_hosts
,
k
;
char
work
[
20
];
char
work
[
20
];
if
(
off
)
return
0
;
if
(
1
!=
sscanf
(
buf
,
"%10s"
,
work
))
if
(
1
!=
sscanf
(
buf
,
"%10s"
,
work
))
return
-
EINVAL
;
return
-
EINVAL
;
{
/* temporary hack around sscanf() problem with -ve nums */
{
/* temporary hack around sscanf() problem with -ve nums */
...
...
include/linux/kobject.h
View file @
28d7baf8
...
@@ -87,7 +87,7 @@ static inline void kset_put(struct kset * k)
...
@@ -87,7 +87,7 @@ static inline void kset_put(struct kset * k)
}
}
extern
struct
kobject
*
kset_find_obj
(
struct
kset
*
,
char
*
);
extern
struct
kobject
*
kset_find_obj
(
struct
kset
*
,
c
onst
c
har
*
);
struct
subsystem
{
struct
subsystem
{
...
...
lib/kobject.c
View file @
28d7baf8
...
@@ -295,7 +295,7 @@ void kset_unregister(struct kset * k)
...
@@ -295,7 +295,7 @@ void kset_unregister(struct kset * k)
* looking for a matching kobject. Return object if found.
* looking for a matching kobject. Return object if found.
*/
*/
struct
kobject
*
kset_find_obj
(
struct
kset
*
kset
,
char
*
name
)
struct
kobject
*
kset_find_obj
(
struct
kset
*
kset
,
c
onst
c
har
*
name
)
{
{
struct
list_head
*
entry
;
struct
list_head
*
entry
;
struct
kobject
*
ret
=
NULL
;
struct
kobject
*
ret
=
NULL
;
...
@@ -387,6 +387,8 @@ EXPORT_SYMBOL(kobject_unregister);
...
@@ -387,6 +387,8 @@ EXPORT_SYMBOL(kobject_unregister);
EXPORT_SYMBOL
(
kobject_get
);
EXPORT_SYMBOL
(
kobject_get
);
EXPORT_SYMBOL
(
kobject_put
);
EXPORT_SYMBOL
(
kobject_put
);
EXPORT_SYMBOL
(
kset_find_obj
);
EXPORT_SYMBOL
(
subsystem_init
);
EXPORT_SYMBOL
(
subsystem_init
);
EXPORT_SYMBOL
(
subsystem_register
);
EXPORT_SYMBOL
(
subsystem_register
);
EXPORT_SYMBOL
(
subsystem_unregister
);
EXPORT_SYMBOL
(
subsystem_unregister
);
...
...
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