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

[PATCH] stallion cleanup

	switched to explicit devfs_register()/devfs_remove(), killed gratitious
devfs_handle_t variables.
parent c04ad400
...@@ -143,8 +143,6 @@ static int stli_nrbrds = sizeof(stli_brdconf) / sizeof(stlconf_t); ...@@ -143,8 +143,6 @@ static int stli_nrbrds = sizeof(stli_brdconf) / sizeof(stlconf_t);
*/ */
#define STLI_EISAPROBE 0 #define STLI_EISAPROBE 0
static devfs_handle_t devfs_handle;
/*****************************************************************************/ /*****************************************************************************/
/* /*
...@@ -867,7 +865,9 @@ void cleanup_module() ...@@ -867,7 +865,9 @@ void cleanup_module()
restore_flags(flags); restore_flags(flags);
return; return;
} }
devfs_unregister (devfs_handle); for (i = 0; i < 4; i++)
devfs_remove("staliomem/%d", i);
devfs_remove("staliomem");
if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, " printk("STALLION: failed to un-register serial memory device, "
"errno=%d\n", -i); "errno=%d\n", -i);
...@@ -5307,6 +5307,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un ...@@ -5307,6 +5307,7 @@ static int stli_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, un
int __init stli_init(void) int __init stli_init(void)
{ {
int i;
printk(KERN_INFO "%s: version %s\n", stli_drvtitle, stli_drvversion); printk(KERN_INFO "%s: version %s\n", stli_drvtitle, stli_drvversion);
stli_initbrds(); stli_initbrds();
...@@ -5331,11 +5332,15 @@ int __init stli_init(void) ...@@ -5331,11 +5332,15 @@ int __init stli_init(void)
printk(KERN_ERR "STALLION: failed to register serial memory " printk(KERN_ERR "STALLION: failed to register serial memory "
"device\n"); "device\n");
devfs_handle = devfs_mk_dir (NULL, "staliomem", NULL); devfs_mk_dir (NULL, "staliomem", NULL);
devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT, for (i = 0; i < 4; i++) {
STL_SIOMEMMAJOR, 0, char name[16];
sprintf(name, "staliomem/%d", i);
devfs_register(NULL, name, DEVFS_FL_DEFAULT,
STL_SIOMEMMAJOR, i,
S_IFCHR | S_IRUSR | S_IWUSR, S_IFCHR | S_IRUSR | S_IWUSR,
&stli_fsiomem, NULL); &stli_fsiomem, NULL);
}
/* /*
* Set up the tty driver structure and register us as a driver. * Set up the tty driver structure and register us as a driver.
......
...@@ -751,8 +751,6 @@ static struct file_operations stl_fsiomem = { ...@@ -751,8 +751,6 @@ static struct file_operations stl_fsiomem = {
/*****************************************************************************/ /*****************************************************************************/
static devfs_handle_t devfs_handle;
#ifdef MODULE #ifdef MODULE
/* /*
...@@ -809,7 +807,9 @@ void cleanup_module() ...@@ -809,7 +807,9 @@ void cleanup_module()
restore_flags(flags); restore_flags(flags);
return; return;
} }
devfs_unregister (devfs_handle); for (i = 0; i < 4; i++)
devfs_remove("staliomem/%d", i);
devfs_remove("staliomem");
if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem"))) if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, " printk("STALLION: failed to un-register serial memory device, "
"errno=%d\n", -i); "errno=%d\n", -i);
...@@ -3191,6 +3191,7 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns ...@@ -3191,6 +3191,7 @@ static int stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, uns
int __init stl_init(void) int __init stl_init(void)
{ {
int i;
printk(KERN_INFO "%s: version %s\n", stl_drvtitle, stl_drvversion); printk(KERN_INFO "%s: version %s\n", stl_drvtitle, stl_drvversion);
stl_initbrds(); stl_initbrds();
...@@ -3209,11 +3210,15 @@ int __init stl_init(void) ...@@ -3209,11 +3210,15 @@ int __init stl_init(void)
*/ */
if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem)) if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
printk("STALLION: failed to register serial board device\n"); printk("STALLION: failed to register serial board device\n");
devfs_handle = devfs_mk_dir (NULL, "staliomem", NULL); devfs_mk_dir (NULL, "staliomem", NULL);
devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT, for (i = 0; i < 4; i++) {
STL_SIOMEMMAJOR, 0, char name[16];
sprintf(name, "staliomem/%d", i);
devfs_register(NULL, name, DEVFS_FL_DEFAULT,
STL_SIOMEMMAJOR, i,
S_IFCHR | S_IRUSR | S_IWUSR, S_IFCHR | S_IRUSR | S_IWUSR,
&stl_fsiomem, NULL); &stl_fsiomem, NULL);
}
/* /*
* Set up the tty driver structure and register us as a driver. * Set up the tty driver structure and register us as a driver.
......
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