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
b11b6f2c
Commit
b11b6f2c
authored
Jun 23, 2003
by
Bartlomiej Zolnierkiewicz
Committed by
Linus Torvalds
Jun 23, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] call setup_driver_defaults() only once for each driver
parent
b3e5c1ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
drivers/ide/ide.c
drivers/ide/ide.c
+6
-7
No files found.
drivers/ide/ide.c
View file @
b11b6f2c
...
...
@@ -216,7 +216,7 @@ EXPORT_SYMBOL(idetape);
EXPORT_SYMBOL
(
idescsi
);
extern
ide_driver_t
idedefault_driver
;
static
void
setup_driver_defaults
(
ide_drive_t
*
drive
);
static
void
setup_driver_defaults
(
ide_driver_t
*
driver
);
/*
* Do not even *think* about calling this!
...
...
@@ -275,7 +275,6 @@ static void init_hwif_data (unsigned int index)
drive
->
using_dma
=
0
;
drive
->
is_flash
=
0
;
drive
->
driver
=
&
idedefault_driver
;
setup_driver_defaults
(
drive
);
drive
->
vdma
=
0
;
INIT_LIST_HEAD
(
&
drive
->
list
);
}
...
...
@@ -308,6 +307,8 @@ static void __init init_ide_data (void)
return
;
/* already initialized */
magic_cookie
=
0
;
setup_driver_defaults
(
&
idedefault_driver
);
/* Initialise all interface structures */
for
(
index
=
0
;
index
<
MAX_HWIFS
;
++
index
)
init_hwif_data
(
index
);
...
...
@@ -2344,10 +2345,8 @@ static ide_startstop_t default_abort (ide_drive_t *drive, const char *msg)
return
ide_abort
(
drive
,
msg
);
}
static
void
setup_driver_defaults
(
ide_drive
_t
*
drive
)
static
void
setup_driver_defaults
(
ide_drive
r_t
*
d
)
{
ide_driver_t
*
d
=
drive
->
driver
;
if
(
d
->
cleanup
==
NULL
)
d
->
cleanup
=
default_cleanup
;
if
(
d
->
shutdown
==
NULL
)
d
->
shutdown
=
default_shutdown
;
if
(
d
->
flushcache
==
NULL
)
d
->
flushcache
=
default_flushcache
;
...
...
@@ -2375,7 +2374,6 @@ int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int versio
return
1
;
}
drive
->
driver
=
driver
;
setup_driver_defaults
(
drive
);
spin_unlock_irqrestore
(
&
ide_lock
,
flags
);
spin_lock
(
&
drives_lock
);
list_add_tail
(
&
drive
->
list
,
&
driver
->
drives
);
...
...
@@ -2422,7 +2420,6 @@ int ide_unregister_subdriver (ide_drive_t *drive)
#endif
auto_remove_settings
(
drive
);
drive
->
driver
=
&
idedefault_driver
;
setup_driver_defaults
(
drive
);
spin_unlock_irqrestore
(
&
ide_lock
,
flags
);
up
(
&
ide_setting_sem
);
spin_lock
(
&
drives_lock
);
...
...
@@ -2447,6 +2444,8 @@ int ide_register_driver(ide_driver_t *driver)
struct
list_head
*
list_loop
;
struct
list_head
*
tmp_storage
;
setup_driver_defaults
(
driver
);
spin_lock
(
&
drivers_lock
);
list_add
(
&
driver
->
drivers
,
&
drivers
);
spin_unlock
(
&
drivers_lock
);
...
...
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