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
9dfdc016
Commit
9dfdc016
authored
Apr 02, 2002
by
Dave Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Cyclades driver region cleanup
parent
a1146f52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
5 deletions
+33
-5
drivers/char/cyclades.c
drivers/char/cyclades.c
+33
-5
No files found.
drivers/char/cyclades.c
View file @
9dfdc016
...
...
@@ -4965,6 +4965,8 @@ cy_detect_pci(void)
uclong
Ze_addr0
[
NR_CARDS
],
Ze_addr2
[
NR_CARDS
],
ZeIndex
=
0
;
uclong
Ze_phys0
[
NR_CARDS
],
Ze_phys2
[
NR_CARDS
];
unsigned
char
Ze_irq
[
NR_CARDS
];
struct
resource
*
resource
;
unsigned
long
res_start
,
res_len
;
for
(
i
=
0
;
i
<
NR_CARDS
;
i
++
)
{
/* look for a Cyclades card by vendor and device id */
...
...
@@ -5012,7 +5014,15 @@ cy_detect_pci(void)
/* Although we don't use this I/O region, we should
request it from the kernel anyway, to avoid problems
with other drivers accessing it. */
request_region
(
cy_pci_phys1
,
CyPCI_Yctl
,
"Cyclom-Y"
);
resource
=
request_region
(
cy_pci_phys1
,
CyPCI_Yctl
,
"Cyclom-Y"
);
if
(
resource
==
NULL
)
{
printk
(
KERN_ERR
"cyclades: failed to allocate IO "
"resource at 0x%lx
\n
"
,
cy_pci_phys1
);
continue
;
}
res_start
=
cy_pci_phys1
;
res_len
=
CyPCI_Yctl
;
#if defined(__alpha__)
if
(
device_id
==
PCI_DEVICE_ID_CYCLOM_Y_Lo
)
{
/* below 1M? */
...
...
@@ -5083,6 +5093,10 @@ cy_detect_pci(void)
cy_card
[
j
].
bus_index
=
1
;
cy_card
[
j
].
first_line
=
cy_next_channel
;
cy_card
[
j
].
num_chips
=
cy_pci_nchan
/
4
;
cy_card
[
j
].
resource
=
resource
;
cy_card
[
j
].
res_start
=
res_start
;
cy_card
[
j
].
res_len
=
res_len
;
resource
=
NULL
;
/* For next card */
/* enable interrupts in the PCI interface */
plx_ver
=
cy_readb
(
cy_pci_addr2
+
CyPLX_VER
)
&
0x0f
;
...
...
@@ -5162,7 +5176,15 @@ cy_detect_pci(void)
/* Although we don't use this I/O region, we should
request it from the kernel anyway, to avoid problems
with other drivers accessing it. */
request_region
(
cy_pci_phys1
,
CyPCI_Zctl
,
"Cyclades-Z"
);
resource
=
request_region
(
cy_pci_phys1
,
CyPCI_Zctl
,
"Cyclades-Z"
);
if
(
resource
==
NULL
)
{
printk
(
KERN_ERR
"cyclades: failed ot allocate IO resource "
"at 0x%lx
\n
"
,
cy_pci_phys1
);
continue
;
}
res_start
=
cy_pci_phys1
;
res_len
=
CyPCI_Zctl
;
if
(
mailbox
==
ZE_V1
)
{
cy_pci_addr2
=
(
ulong
)
ioremap
(
cy_pci_phys2
,
CyPCI_Ze_win
);
...
...
@@ -5261,6 +5283,10 @@ cy_detect_pci(void)
cy_card
[
j
].
bus_index
=
1
;
cy_card
[
j
].
first_line
=
cy_next_channel
;
cy_card
[
j
].
num_chips
=
-
1
;
cy_card
[
j
].
resource
=
resource
;
cy_card
[
j
].
res_start
=
res_start
;
cy_card
[
j
].
res_len
=
res_len
;
resource
=
NULL
;
/* For next card */
/* print message */
#ifdef CONFIG_CYZ_INTR
...
...
@@ -5787,6 +5813,8 @@ cy_cleanup_module(void)
#endif
/* CONFIG_CYZ_INTR */
)
free_irq
(
cy_card
[
i
].
irq
,
&
cy_card
[
i
]);
if
(
cy_card
[
i
].
resource
)
release_region
(
cy_card
[
i
].
res_start
,
cy_card
[
i
].
res_len
);
}
}
if
(
tmp_buf
)
{
...
...
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