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
c9ad2f34
Commit
c9ad2f34
authored
May 25, 2003
by
Dave Jones
Committed by
Jeff Garzik
May 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] xircom init cleanups
parent
cb9370a8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
drivers/net/tulip/xircom_cb.c
drivers/net/tulip/xircom_cb.c
+17
-20
No files found.
drivers/net/tulip/xircom_cb.c
View file @
c9ad2f34
...
@@ -243,38 +243,29 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
...
@@ -243,38 +243,29 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/*
/*
Before changing the hardware, allocate the memory.
Before changing the hardware, allocate the memory.
This way, we can fail gracefully if not enough memory
This way, we can fail gracefully if not enough memory
is available.
is available.
*/
*/
private
=
kmalloc
(
sizeof
(
*
private
),
GFP_KERNEL
);
if
((
dev
=
init_etherdev
(
NULL
,
sizeof
(
struct
xircom_private
)))
==
NULL
)
{
memset
(
private
,
0
,
sizeof
(
struct
xircom_private
));
printk
(
KERN_ERR
"xircom_probe: failed to allocate etherdev
\n
"
);
goto
device_fail
;
}
private
=
dev
->
priv
;
/* Allocate the send/receive buffers */
/* Allocate the send/receive buffers */
private
->
rx_buffer
=
pci_alloc_consistent
(
pdev
,
8192
,
&
private
->
rx_dma_handle
);
private
->
rx_buffer
=
pci_alloc_consistent
(
pdev
,
8192
,
&
private
->
rx_dma_handle
);
if
(
private
->
rx_buffer
==
NULL
)
{
if
(
private
->
rx_buffer
==
NULL
)
{
printk
(
KERN_ERR
"xircom_probe: no memory for rx buffer
\n
"
);
printk
(
KERN_ERR
"xircom_probe: no memory for rx buffer
\n
"
);
kfree
(
private
);
goto
rx_buf_fail
;
return
-
ENODEV
;
}
}
private
->
tx_buffer
=
pci_alloc_consistent
(
pdev
,
8192
,
&
private
->
tx_dma_handle
);
private
->
tx_buffer
=
pci_alloc_consistent
(
pdev
,
8192
,
&
private
->
tx_dma_handle
);
if
(
private
->
tx_buffer
==
NULL
)
{
if
(
private
->
tx_buffer
==
NULL
)
{
printk
(
KERN_ERR
"xircom_probe: no memory for tx buffer
\n
"
);
printk
(
KERN_ERR
"xircom_probe: no memory for tx buffer
\n
"
);
kfree
(
private
->
rx_buffer
);
goto
tx_buf_fail
;
kfree
(
private
);
return
-
ENODEV
;
}
dev
=
init_etherdev
(
dev
,
0
);
if
(
dev
==
NULL
)
{
printk
(
KERN_ERR
"xircom_probe: failed to allocate etherdev
\n
"
);
kfree
(
private
->
rx_buffer
);
kfree
(
private
->
tx_buffer
);
kfree
(
private
);
return
-
ENODEV
;
}
}
SET_MODULE_OWNER
(
dev
);
SET_MODULE_OWNER
(
dev
);
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
SET_NETDEV_DEV
(
dev
,
&
pdev
->
dev
);
printk
(
KERN_INFO
"%s: Xircom cardbus revision %i at irq %i
\n
"
,
dev
->
name
,
chip_rev
,
pdev
->
irq
);
printk
(
KERN_INFO
"%s: Xircom cardbus revision %i at irq %i
\n
"
,
dev
->
name
,
chip_rev
,
pdev
->
irq
);
...
@@ -313,6 +304,13 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
...
@@ -313,6 +304,13 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
leave
(
"xircom_probe"
);
leave
(
"xircom_probe"
);
return
0
;
return
0
;
tx_buf_fail:
kfree
(
private
->
rx_buffer
);
rx_buf_fail:
kfree
(
dev
);
device_fail:
return
-
ENODEV
;
}
}
...
@@ -337,7 +335,6 @@ static void __devexit xircom_remove(struct pci_dev *pdev)
...
@@ -337,7 +335,6 @@ static void __devexit xircom_remove(struct pci_dev *pdev)
pci_free_consistent
(
pdev
,
8192
,
card
->
tx_buffer
,
card
->
tx_dma_handle
);
pci_free_consistent
(
pdev
,
8192
,
card
->
tx_buffer
,
card
->
tx_dma_handle
);
card
->
tx_buffer
=
NULL
;
card
->
tx_buffer
=
NULL
;
}
}
kfree
(
card
);
}
}
release_region
(
dev
->
base_addr
,
128
);
release_region
(
dev
->
base_addr
,
128
);
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
...
...
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