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