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
6ccc6d7e
Commit
6ccc6d7e
authored
Oct 13, 2008
by
Bartlomiej Zolnierkiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ide-generic: no need to probe all ports at once
Signed-off-by:
Bartlomiej Zolnierkiewicz
<
bzolnier@gmail.com
>
parent
bfa7d8e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
35 deletions
+12
-35
drivers/ide/ide-generic.c
drivers/ide/ide-generic.c
+12
-35
No files found.
drivers/ide/ide-generic.c
View file @
6ccc6d7e
...
@@ -137,10 +137,9 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
...
@@ -137,10 +137,9 @@ static void ide_generic_check_pci_legacy_iobases(int *primary, int *secondary)
static
int
__init
ide_generic_init
(
void
)
static
int
__init
ide_generic_init
(
void
)
{
{
hw_regs_t
hw
[
MAX_HWIFS
],
*
hws
[
MAX_HWIFS
];
hw_regs_t
hw
,
*
hws
[]
=
{
&
hw
,
NULL
,
NULL
,
NULL
};
struct
ide_host
*
host
;
unsigned
long
io_addr
;
unsigned
long
io_addr
;
int
i
,
rc
,
primary
=
0
,
secondary
=
0
;
int
i
,
rc
=
0
,
primary
=
0
,
secondary
=
0
;
#ifdef CONFIG_MIPS
#ifdef CONFIG_MIPS
if
(
!
ide_probe_legacy
())
if
(
!
ide_probe_legacy
())
...
@@ -161,13 +160,9 @@ static int __init ide_generic_init(void)
...
@@ -161,13 +160,9 @@ static int __init ide_generic_init(void)
printk
(
KERN_INFO
DRV_NAME
": enforcing probing of I/O ports "
printk
(
KERN_INFO
DRV_NAME
": enforcing probing of I/O ports "
"upon user request
\n
"
);
"upon user request
\n
"
);
memset
(
hws
,
0
,
sizeof
(
hw_regs_t
*
)
*
MAX_HWIFS
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
legacy_bases
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
legacy_bases
);
i
++
)
{
io_addr
=
legacy_bases
[
i
];
io_addr
=
legacy_bases
[
i
];
hws
[
i
]
=
NULL
;
if
((
probe_mask
&
(
1
<<
i
))
&&
io_addr
)
{
if
((
probe_mask
&
(
1
<<
i
))
&&
io_addr
)
{
if
(
!
request_region
(
io_addr
,
8
,
DRV_NAME
))
{
if
(
!
request_region
(
io_addr
,
8
,
DRV_NAME
))
{
printk
(
KERN_ERR
"%s: I/O resource 0x%lX-0x%lX "
printk
(
KERN_ERR
"%s: I/O resource 0x%lX-0x%lX "
...
@@ -184,45 +179,27 @@ static int __init ide_generic_init(void)
...
@@ -184,45 +179,27 @@ static int __init ide_generic_init(void)
continue
;
continue
;
}
}
memset
(
&
hw
[
i
],
0
,
sizeof
(
hw
[
i
]
));
memset
(
&
hw
,
0
,
sizeof
(
hw
));
ide_std_init_ports
(
&
hw
[
i
]
,
io_addr
,
io_addr
+
0x206
);
ide_std_init_ports
(
&
hw
,
io_addr
,
io_addr
+
0x206
);
#ifdef CONFIG_IA64
#ifdef CONFIG_IA64
hw
[
i
]
.
irq
=
isa_irq_to_vector
(
legacy_irqs
[
i
]);
hw
.
irq
=
isa_irq_to_vector
(
legacy_irqs
[
i
]);
#else
#else
hw
[
i
]
.
irq
=
legacy_irqs
[
i
];
hw
.
irq
=
legacy_irqs
[
i
];
#endif
#endif
hw
[
i
]
.
chipset
=
ide_generic
;
hw
.
chipset
=
ide_generic
;
hws
[
i
]
=
&
hw
[
i
];
rc
=
ide_host_add
(
NULL
,
hws
,
NULL
);
if
(
rc
)
{
release_region
(
io_addr
+
0x206
,
1
);
release_region
(
io_addr
,
8
);
}
}
}
}
}
host
=
ide_host_alloc_all
(
NULL
,
hws
);
if
(
host
==
NULL
)
{
rc
=
-
ENOMEM
;
goto
err
;
}
rc
=
ide_host_register
(
host
,
NULL
,
hws
);
if
(
rc
)
goto
err_free
;
if
(
ide_generic_sysfs_init
())
if
(
ide_generic_sysfs_init
())
printk
(
KERN_ERR
DRV_NAME
": failed to create ide_generic "
printk
(
KERN_ERR
DRV_NAME
": failed to create ide_generic "
"class
\n
"
);
"class
\n
"
);
return
0
;
err_free:
ide_host_free
(
host
);
err:
for
(
i
=
0
;
i
<
MAX_HWIFS
;
i
++
)
{
if
(
hws
[
i
]
==
NULL
)
continue
;
io_addr
=
hws
[
i
]
->
io_ports
.
data_addr
;
release_region
(
io_addr
+
0x206
,
1
);
release_region
(
io_addr
,
8
);
}
return
rc
;
return
rc
;
}
}
...
...
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