Commit e752c144 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] isdn cleanup

	switched to devfs_remove(), killed gratitious devfs_handle_t fields.
parent 5781aaf2
...@@ -51,8 +51,6 @@ static char *DRIVERNAME = ...@@ -51,8 +51,6 @@ static char *DRIVERNAME =
static char *DRIVERLNAME = "diva_mnt"; static char *DRIVERLNAME = "diva_mnt";
char *DRIVERRELEASE = "2.0"; char *DRIVERRELEASE = "2.0";
static devfs_handle_t devfs_handle;
static wait_queue_head_t msgwaitq; static wait_queue_head_t msgwaitq;
static DECLARE_MUTEX(opened_sem); static DECLARE_MUTEX(opened_sem);
static int opened; static int opened;
...@@ -412,8 +410,7 @@ static struct file_operations divas_maint_fops = { ...@@ -412,8 +410,7 @@ static struct file_operations divas_maint_fops = {
static void divas_maint_unregister_chrdev(void) static void divas_maint_unregister_chrdev(void)
{ {
if (devfs_handle) devfs_remove("DivasMAINT");
devfs_unregister(devfs_handle);
unregister_chrdev(major, "DivasMAINT"); unregister_chrdev(major, "DivasMAINT");
} }
...@@ -425,7 +422,6 @@ static int DIVA_INIT_FUNCTION divas_maint_register_chrdev(void) ...@@ -425,7 +422,6 @@ static int DIVA_INIT_FUNCTION divas_maint_register_chrdev(void)
DRIVERLNAME); DRIVERLNAME);
return (0); return (0);
} }
devfs_handle =
devfs_register(NULL, "DivasMAINT", DEVFS_FL_DEFAULT, major, 0, devfs_register(NULL, "DivasMAINT", DEVFS_FL_DEFAULT, major, 0,
S_IFCHR | S_IRUSR | S_IWUSR, &divas_maint_fops, S_IFCHR | S_IRUSR | S_IWUSR, &divas_maint_fops,
NULL); NULL);
......
...@@ -52,8 +52,6 @@ static char *DRIVERNAME = "Eicon DIVA - User IDI (http://www.melware.net)"; ...@@ -52,8 +52,6 @@ static char *DRIVERNAME = "Eicon DIVA - User IDI (http://www.melware.net)";
static char *DRIVERLNAME = "diva_idi"; static char *DRIVERLNAME = "diva_idi";
char *DRIVERRELEASE = "2.0"; char *DRIVERRELEASE = "2.0";
static devfs_handle_t devfs_handle;
extern int idifunc_init(void); extern int idifunc_init(void);
extern void idifunc_finit(void); extern void idifunc_finit(void);
...@@ -171,8 +169,7 @@ static struct file_operations divas_idi_fops = { ...@@ -171,8 +169,7 @@ static struct file_operations divas_idi_fops = {
static void divas_idi_unregister_chrdev(void) static void divas_idi_unregister_chrdev(void)
{ {
if (devfs_handle) devfs_remove("DivasIDI");
devfs_unregister(devfs_handle);
unregister_chrdev(major, "DivasIDI"); unregister_chrdev(major, "DivasIDI");
} }
...@@ -184,7 +181,6 @@ static int DIVA_INIT_FUNCTION divas_idi_register_chrdev(void) ...@@ -184,7 +181,6 @@ static int DIVA_INIT_FUNCTION divas_idi_register_chrdev(void)
DRIVERLNAME); DRIVERLNAME);
return (0); return (0);
} }
devfs_handle =
devfs_register(NULL, "DivasIDI", DEVFS_FL_DEFAULT, major, 0, devfs_register(NULL, "DivasIDI", DEVFS_FL_DEFAULT, major, 0,
S_IFCHR | S_IRUSR | S_IWUSR, &divas_idi_fops, S_IFCHR | S_IRUSR | S_IWUSR, &divas_idi_fops,
NULL); NULL);
......
...@@ -70,8 +70,6 @@ extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf); ...@@ -70,8 +70,6 @@ extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf);
extern int divasfunc_init(void); extern int divasfunc_init(void);
extern void divasfunc_exit(void); extern void divasfunc_exit(void);
static devfs_handle_t devfs_handle;
typedef struct _diva_os_thread_dpc { typedef struct _diva_os_thread_dpc {
struct tasklet_struct divas_task; struct tasklet_struct divas_task;
struct work_struct trap_script_task; struct work_struct trap_script_task;
...@@ -779,8 +777,7 @@ static struct file_operations divas_fops = { ...@@ -779,8 +777,7 @@ static struct file_operations divas_fops = {
static void divas_unregister_chrdev(void) static void divas_unregister_chrdev(void)
{ {
if (devfs_handle) devfs_remove("Divas");
devfs_unregister(devfs_handle);
unregister_chrdev(major, "Divas"); unregister_chrdev(major, "Divas");
} }
...@@ -792,7 +789,6 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void) ...@@ -792,7 +789,6 @@ static int DIVA_INIT_FUNCTION divas_register_chrdev(void)
DRIVERLNAME); DRIVERLNAME);
return (0); return (0);
} }
devfs_handle =
devfs_register(NULL, "Divas", DEVFS_FL_DEFAULT, major, 0, devfs_register(NULL, "Divas", DEVFS_FL_DEFAULT, major, 0,
S_IFCHR | S_IRUSR | S_IWUSR, &divas_fops, NULL); S_IFCHR | S_IRUSR | S_IWUSR, &divas_fops, NULL);
......
...@@ -2165,22 +2165,19 @@ isdn_hard_header_len(void) ...@@ -2165,22 +2165,19 @@ isdn_hard_header_len(void)
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
static devfs_handle_t devfs_handle;
static void isdn_register_devfs(int k) static void isdn_register_devfs(int k)
{ {
char buf[11]; char buf[16];
sprintf (buf, "isdnctrl%d", k); sprintf (buf, "isdn/isdnctrl%d", k);
dev->devfs_handle_isdnctrlX[k] = devfs_register(NULL, buf, DEVFS_FL_DEFAULT,
devfs_register (devfs_handle, buf, DEVFS_FL_DEFAULT,
ISDN_MAJOR, ISDN_MINOR_CTRL + k, 0600 | S_IFCHR, ISDN_MAJOR, ISDN_MINOR_CTRL + k, 0600 | S_IFCHR,
&isdn_fops, NULL); &isdn_fops, NULL);
} }
static void isdn_unregister_devfs(int k) static void isdn_unregister_devfs(int k)
{ {
devfs_unregister (dev->devfs_handle_isdnctrlX[k]); devfs_remove("isdn/isdnctrl%d", k);
} }
static void isdn_init_devfs(void) static void isdn_init_devfs(void)
...@@ -2189,25 +2186,22 @@ static void isdn_init_devfs(void) ...@@ -2189,25 +2186,22 @@ static void isdn_init_devfs(void)
int i; int i;
# endif # endif
devfs_handle = devfs_mk_dir (NULL, "isdn", NULL); devfs_mk_dir (NULL, "isdn", NULL);
# ifdef CONFIG_ISDN_PPP # ifdef CONFIG_ISDN_PPP
for (i = 0; i < ISDN_MAX_CHANNELS; i++) { for (i = 0; i < ISDN_MAX_CHANNELS; i++) {
char buf[8]; char buf[16];
sprintf (buf, "ippp%d", i); sprintf (buf, "isdn/ippp%d", i);
dev->devfs_handle_ipppX[i] = devfs_register(NULL, buf, DEVFS_FL_DEFAULT,
devfs_register (devfs_handle, buf, DEVFS_FL_DEFAULT,
ISDN_MAJOR, ISDN_MINOR_PPP + i, ISDN_MAJOR, ISDN_MINOR_PPP + i,
0600 | S_IFCHR, &isdn_fops, NULL); 0600 | S_IFCHR, &isdn_fops, NULL);
} }
# endif # endif
dev->devfs_handle_isdninfo = devfs_register(NULL, "isdn/isdninfo", DEVFS_FL_DEFAULT,
devfs_register (devfs_handle, "isdninfo", DEVFS_FL_DEFAULT,
ISDN_MAJOR, ISDN_MINOR_STATUS, 0600 | S_IFCHR, ISDN_MAJOR, ISDN_MINOR_STATUS, 0600 | S_IFCHR,
&isdn_fops, NULL); &isdn_fops, NULL);
dev->devfs_handle_isdnctrl = devfs_register(NULL, "isdn/isdnctrl", DEVFS_FL_DEFAULT,
devfs_register (devfs_handle, "isdnctrl", DEVFS_FL_DEFAULT,
ISDN_MAJOR, ISDN_MINOR_CTRL, 0600 | S_IFCHR, ISDN_MAJOR, ISDN_MINOR_CTRL, 0600 | S_IFCHR,
&isdn_fops, NULL); &isdn_fops, NULL);
} }
...@@ -2217,11 +2211,11 @@ static void isdn_cleanup_devfs(void) ...@@ -2217,11 +2211,11 @@ static void isdn_cleanup_devfs(void)
# ifdef CONFIG_ISDN_PPP # ifdef CONFIG_ISDN_PPP
int i; int i;
for (i = 0; i < ISDN_MAX_CHANNELS; i++) for (i = 0; i < ISDN_MAX_CHANNELS; i++)
devfs_unregister (dev->devfs_handle_ipppX[i]); devfs_remove("isdn/ippp%d", i);
# endif # endif
devfs_unregister (dev->devfs_handle_isdninfo); devfs_remove("isdn/isdninfo");
devfs_unregister (dev->devfs_handle_isdnctrl); devfs_remove("isdn/isdnctrl");
devfs_unregister (devfs_handle); devfs_remove("isdn");
} }
#else /* CONFIG_DEVFS_FS */ #else /* CONFIG_DEVFS_FS */
......
...@@ -408,14 +408,6 @@ typedef struct isdn_devt { ...@@ -408,14 +408,6 @@ typedef struct isdn_devt {
struct task_struct *profd; /* For iprofd */ struct task_struct *profd; /* For iprofd */
struct semaphore sem; /* serialize list access*/ struct semaphore sem; /* serialize list access*/
unsigned long global_features; unsigned long global_features;
#ifdef CONFIG_DEVFS_FS
devfs_handle_t devfs_handle_isdninfo;
devfs_handle_t devfs_handle_isdnctrl;
devfs_handle_t devfs_handle_isdnctrlX[ISDN_MAX_CHANNELS];
#ifdef CONFIG_ISDN_PPP
devfs_handle_t devfs_handle_ipppX[ISDN_MAX_CHANNELS];
#endif
#endif /* CONFIG_DEVFS_FS */
} isdn_dev; } isdn_dev;
extern isdn_dev *dev; extern isdn_dev *dev;
......
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