Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
607cf4d9
Commit
607cf4d9
authored
Oct 27, 2005
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2O: Clean up some pretty bad driver model abuses in the i2o code
Signed-off-by:
Greg Kroah-Hartman
<
gregkh@suse.de
>
parent
4f5ca09e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
drivers/message/i2o/iop.c
drivers/message/i2o/iop.c
+10
-12
include/linux/i2o.h
include/linux/i2o.h
+1
-1
No files found.
drivers/message/i2o/iop.c
View file @
607cf4d9
...
@@ -833,6 +833,7 @@ void i2o_iop_remove(struct i2o_controller *c)
...
@@ -833,6 +833,7 @@ void i2o_iop_remove(struct i2o_controller *c)
list_for_each_entry_safe
(
dev
,
tmp
,
&
c
->
devices
,
list
)
list_for_each_entry_safe
(
dev
,
tmp
,
&
c
->
devices
,
list
)
i2o_device_remove
(
dev
);
i2o_device_remove
(
dev
);
class_device_unregister
(
c
->
classdev
);
device_del
(
&
c
->
device
);
device_del
(
&
c
->
device
);
/* Ask the IOP to switch to RESET state */
/* Ask the IOP to switch to RESET state */
...
@@ -1077,9 +1078,7 @@ static void i2o_iop_release(struct device *dev)
...
@@ -1077,9 +1078,7 @@ static void i2o_iop_release(struct device *dev)
};
};
/* I2O controller class */
/* I2O controller class */
static
struct
class
i2o_controller_class
=
{
static
struct
class
*
i2o_controller_class
;
.
name
=
"i2o_controller"
,
};
/**
/**
* i2o_iop_alloc - Allocate and initialize a i2o_controller struct
* i2o_iop_alloc - Allocate and initialize a i2o_controller struct
...
@@ -1110,14 +1109,10 @@ struct i2o_controller *i2o_iop_alloc(void)
...
@@ -1110,14 +1109,10 @@ struct i2o_controller *i2o_iop_alloc(void)
sprintf
(
c
->
name
,
"iop%d"
,
c
->
unit
);
sprintf
(
c
->
name
,
"iop%d"
,
c
->
unit
);
device_initialize
(
&
c
->
device
);
device_initialize
(
&
c
->
device
);
class_device_initialize
(
&
c
->
classdev
);
c
->
device
.
release
=
&
i2o_iop_release
;
c
->
device
.
release
=
&
i2o_iop_release
;
c
->
classdev
.
class
=
&
i2o_controller_class
;
c
->
classdev
.
dev
=
&
c
->
device
;
snprintf
(
c
->
device
.
bus_id
,
BUS_ID_SIZE
,
"iop%d"
,
c
->
unit
);
snprintf
(
c
->
device
.
bus_id
,
BUS_ID_SIZE
,
"iop%d"
,
c
->
unit
);
snprintf
(
c
->
classdev
.
class_id
,
BUS_ID_SIZE
,
"iop%d"
,
c
->
unit
);
#if BITS_PER_LONG == 64
#if BITS_PER_LONG == 64
spin_lock_init
(
&
c
->
context_list_lock
);
spin_lock_init
(
&
c
->
context_list_lock
);
...
@@ -1146,7 +1141,9 @@ int i2o_iop_add(struct i2o_controller *c)
...
@@ -1146,7 +1141,9 @@ int i2o_iop_add(struct i2o_controller *c)
goto
iop_reset
;
goto
iop_reset
;
}
}
if
((
rc
=
class_device_add
(
&
c
->
classdev
)))
{
c
->
classdev
=
class_device_create
(
i2o_controller_class
,
0
,
&
c
->
device
,
"iop%d"
,
c
->
unit
);
if
(
IS_ERR
(
c
->
classdev
))
{
osm_err
(
"%s: could not add controller class
\n
"
,
c
->
name
);
osm_err
(
"%s: could not add controller class
\n
"
,
c
->
name
);
goto
device_del
;
goto
device_del
;
}
}
...
@@ -1184,7 +1181,7 @@ int i2o_iop_add(struct i2o_controller *c)
...
@@ -1184,7 +1181,7 @@ int i2o_iop_add(struct i2o_controller *c)
return
0
;
return
0
;
class_del:
class_del:
class_device_
del
(
&
c
->
classdev
);
class_device_
unregister
(
c
->
classdev
);
device_del:
device_del:
device_del
(
&
c
->
device
);
device_del
(
&
c
->
device
);
...
@@ -1250,7 +1247,8 @@ static int __init i2o_iop_init(void)
...
@@ -1250,7 +1247,8 @@ static int __init i2o_iop_init(void)
if
(
rc
)
if
(
rc
)
goto
exit
;
goto
exit
;
if
((
rc
=
class_register
(
&
i2o_controller_class
)))
{
i2o_controller_class
=
class_create
(
THIS_MODULE
,
"i2o_controller"
);
if
(
IS_ERR
(
i2o_controller_class
))
{
osm_err
(
"can't register class i2o_controller
\n
"
);
osm_err
(
"can't register class i2o_controller
\n
"
);
goto
device_exit
;
goto
device_exit
;
}
}
...
@@ -1273,7 +1271,7 @@ static int __init i2o_iop_init(void)
...
@@ -1273,7 +1271,7 @@ static int __init i2o_iop_init(void)
i2o_driver_exit
();
i2o_driver_exit
();
class_exit:
class_exit:
class_
unregister
(
&
i2o_controller_class
);
class_
destroy
(
i2o_controller_class
);
device_exit:
device_exit:
i2o_device_exit
();
i2o_device_exit
();
...
@@ -1292,7 +1290,7 @@ static void __exit i2o_iop_exit(void)
...
@@ -1292,7 +1290,7 @@ static void __exit i2o_iop_exit(void)
i2o_pci_exit
();
i2o_pci_exit
();
i2o_exec_exit
();
i2o_exec_exit
();
i2o_driver_exit
();
i2o_driver_exit
();
class_
unregister
(
&
i2o_controller_class
);
class_
destroy
(
i2o_controller_class
);
i2o_device_exit
();
i2o_device_exit
();
};
};
...
...
include/linux/i2o.h
View file @
607cf4d9
...
@@ -194,7 +194,7 @@ struct i2o_controller {
...
@@ -194,7 +194,7 @@ struct i2o_controller {
struct
resource
mem_resource
;
/* Mem resource allocated to the IOP */
struct
resource
mem_resource
;
/* Mem resource allocated to the IOP */
struct
device
device
;
struct
device
device
;
struct
class_device
classdev
;
/* I2O controller class
*/
struct
class_device
*
classdev
;
/* I2O controller class device
*/
struct
i2o_device
*
exec
;
/* Executive */
struct
i2o_device
*
exec
;
/* Executive */
#if BITS_PER_LONG == 64
#if BITS_PER_LONG == 64
spinlock_t
context_list_lock
;
/* lock for context_list */
spinlock_t
context_list_lock
;
/* lock for context_list */
...
...
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