Commit d5f6d42c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

[NET]: Move dmascc away from setup.c

parent 11c9ddae
...@@ -250,8 +250,6 @@ struct scc_info { ...@@ -250,8 +250,6 @@ struct scc_info {
/* Function declarations */ /* Function declarations */
int dmascc_init(void) __init;
static int setup_adapter(int card_base, int type, int n) __init; static int setup_adapter(int card_base, int type, int n) __init;
static void write_scc(struct scc_priv *priv, int reg, int val); static void write_scc(struct scc_priv *priv, int reg, int val);
...@@ -299,23 +297,12 @@ static struct scc_info *first; ...@@ -299,23 +297,12 @@ static struct scc_info *first;
static unsigned long rand; static unsigned long rand;
/* Module functions */
#ifdef MODULE
MODULE_AUTHOR("Klaus Kudielka"); MODULE_AUTHOR("Klaus Kudielka");
MODULE_DESCRIPTION("Driver for high-speed SCC boards"); MODULE_DESCRIPTION("Driver for high-speed SCC boards");
MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NUM_DEVS) "i"); MODULE_PARM(io, "1-" __MODULE_STRING(MAX_NUM_DEVS) "i");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
static void __exit dmascc_exit(void) {
int init_module(void) {
return dmascc_init();
}
void cleanup_module(void) {
int i; int i;
struct scc_info *info; struct scc_info *info;
...@@ -341,24 +328,16 @@ void cleanup_module(void) { ...@@ -341,24 +328,16 @@ void cleanup_module(void) {
} }
} }
#ifndef MODULE
#else
void __init dmascc_setup(char *str, int *ints) { void __init dmascc_setup(char *str, int *ints) {
int i; int i;
for (i = 0; i < MAX_NUM_DEVS && i < ints[0]; i++) for (i = 0; i < MAX_NUM_DEVS && i < ints[0]; i++)
io[i] = ints[i+1]; io[i] = ints[i+1];
} }
#endif #endif
static int __init dmascc_init(void) {
/* Initialization functions */
int __init dmascc_init(void) {
int h, i, j, n; int h, i, j, n;
int base[MAX_NUM_DEVS], tcmd[MAX_NUM_DEVS], t0[MAX_NUM_DEVS], int base[MAX_NUM_DEVS], tcmd[MAX_NUM_DEVS], t0[MAX_NUM_DEVS],
t1[MAX_NUM_DEVS]; t1[MAX_NUM_DEVS];
...@@ -461,6 +440,9 @@ int __init dmascc_init(void) { ...@@ -461,6 +440,9 @@ int __init dmascc_init(void) {
return -EIO; return -EIO;
} }
module_init(dmascc_init);
module_exit(dmascc_exit);
int __init setup_adapter(int card_base, int type, int n) { int __init setup_adapter(int card_base, int type, int n) {
int i, irq, chip; int i, irq, chip;
...@@ -580,6 +562,7 @@ int __init setup_adapter(int card_base, int type, int n) { ...@@ -580,6 +562,7 @@ int __init setup_adapter(int card_base, int type, int n) {
if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name; if (sizeof(dev->name) == sizeof(char *)) dev->name = priv->name;
#endif #endif
sprintf(dev->name, "dmascc%i", 2*n+i); sprintf(dev->name, "dmascc%i", 2*n+i);
SET_MODULE_OWNER(dev);
dev->base_addr = card_base; dev->base_addr = card_base;
dev->irq = irq; dev->irq = irq;
dev->open = scc_open; dev->open = scc_open;
...@@ -707,12 +690,9 @@ static int scc_open(struct net_device *dev) { ...@@ -707,12 +690,9 @@ static int scc_open(struct net_device *dev) {
struct scc_info *info = priv->info; struct scc_info *info = priv->info;
int card_base = priv->card_base; int card_base = priv->card_base;
MOD_INC_USE_COUNT;
/* Request IRQ if not already used by other channel */ /* Request IRQ if not already used by other channel */
if (!info->irq_used) { if (!info->irq_used) {
if (request_irq(dev->irq, scc_isr, 0, "dmascc", info)) { if (request_irq(dev->irq, scc_isr, 0, "dmascc", info)) {
MOD_DEC_USE_COUNT;
return -EAGAIN; return -EAGAIN;
} }
} }
...@@ -722,7 +702,6 @@ static int scc_open(struct net_device *dev) { ...@@ -722,7 +702,6 @@ static int scc_open(struct net_device *dev) {
if (priv->param.dma >= 0) { if (priv->param.dma >= 0) {
if (request_dma(priv->param.dma, "dmascc")) { if (request_dma(priv->param.dma, "dmascc")) {
if (--info->irq_used == 0) free_irq(dev->irq, info); if (--info->irq_used == 0) free_irq(dev->irq, info);
MOD_DEC_USE_COUNT;
return -EAGAIN; return -EAGAIN;
} else { } else {
unsigned long flags = claim_dma_lock(); unsigned long flags = claim_dma_lock();
...@@ -866,7 +845,6 @@ static int scc_close(struct net_device *dev) { ...@@ -866,7 +845,6 @@ static int scc_close(struct net_device *dev) {
} }
if (--info->irq_used == 0) free_irq(dev->irq, info); if (--info->irq_used == 0) free_irq(dev->irq, info);
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/netlink.h> #include <linux/netlink.h>
extern int dmascc_init(void);
extern int scc_enet_init(void); extern int scc_enet_init(void);
extern int fec_enet_init(void); extern int fec_enet_init(void);
...@@ -29,10 +27,6 @@ static struct net_probe pci_probes[] __initdata = { ...@@ -29,10 +27,6 @@ static struct net_probe pci_probes[] __initdata = {
/* /*
* Early setup devices * Early setup devices
*/ */
#if defined(CONFIG_DMASCC)
{dmascc_init, 0},
#endif
#if defined(CONFIG_SCC_ENET) #if defined(CONFIG_SCC_ENET)
{scc_enet_init, 0}, {scc_enet_init, 0},
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment