Commit 24cade1f authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] vfc cleanup

	switched to devfs_remove(), killed gratitious devfs_handle_t field.
parent 436d67c6
...@@ -128,7 +128,6 @@ struct vfc_dev { ...@@ -128,7 +128,6 @@ struct vfc_dev {
volatile struct vfc_regs *regs; volatile struct vfc_regs *regs;
struct vfc_regs *phys_regs; struct vfc_regs *phys_regs;
unsigned int control_reg; unsigned int control_reg;
devfs_handle_t de;
struct semaphore device_lock_sem; struct semaphore device_lock_sem;
struct timer_list poll_timer; struct timer_list poll_timer;
wait_queue_head_t poll_wait; wait_queue_head_t poll_wait;
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <asm/vfc_ioctls.h> #include <asm/vfc_ioctls.h>
static struct file_operations vfc_fops; static struct file_operations vfc_fops;
static devfs_handle_t devfs_handle; /* For the directory */
struct vfc_dev **vfc_dev_lst; struct vfc_dev **vfc_dev_lst;
static char vfcstr[]="vfc"; static char vfcstr[]="vfc";
static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { static unsigned char saa9051_init_array[VFC_SAA9051_NR] = {
...@@ -144,7 +143,7 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance) ...@@ -144,7 +143,7 @@ int init_vfc_devstruct(struct vfc_dev *dev, int instance)
int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
{ {
char devname[8]; char devname[16];
if(dev == NULL) { if(dev == NULL) {
printk(KERN_ERR "VFC: Bogus pointer passed\n"); printk(KERN_ERR "VFC: Bogus pointer passed\n");
...@@ -168,8 +167,8 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance) ...@@ -168,8 +167,8 @@ int init_vfc_device(struct sbus_dev *sdev,struct vfc_dev *dev, int instance)
if (init_vfc_hw(dev)) if (init_vfc_hw(dev))
return -EIO; return -EIO;
sprintf (devname, "%d", instance); sprintf (devname, "vfc/%d", instance);
dev->de = devfs_register (devfs_handle, devname, DEVFS_FL_DEFAULT, dev->de = devfs_register (NULL, devname, DEVFS_FL_DEFAULT,
VFC_MAJOR, instance, VFC_MAJOR, instance,
S_IFCHR | S_IRUSR | S_IWUSR, S_IFCHR | S_IRUSR | S_IWUSR,
&vfc_fops, NULL); &vfc_fops, NULL);
...@@ -682,8 +681,7 @@ static int vfc_probe(void) ...@@ -682,8 +681,7 @@ static int vfc_probe(void)
kfree(vfc_dev_lst); kfree(vfc_dev_lst);
return -EIO; return -EIO;
} }
devfs_handle = devfs_mk_dir (NULL, "vfc", NULL); devfs_mk_dir (NULL, "vfc", NULL);
instance = 0; instance = 0;
for_all_sbusdev(sdev, sbus) { for_all_sbusdev(sdev, sbus) {
if (strcmp(sdev->prom_name, "vfc") == 0) { if (strcmp(sdev->prom_name, "vfc") == 0) {
...@@ -723,7 +721,7 @@ static void deinit_vfc_device(struct vfc_dev *dev) ...@@ -723,7 +721,7 @@ static void deinit_vfc_device(struct vfc_dev *dev)
{ {
if(dev == NULL) if(dev == NULL)
return; return;
devfs_unregister (dev->de); devfs_remove("vfc/%d", dev->instance);
sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs)); sbus_iounmap((unsigned long)dev->regs, sizeof(struct vfc_regs));
kfree(dev); kfree(dev);
} }
...@@ -737,7 +735,7 @@ void cleanup_module(void) ...@@ -737,7 +735,7 @@ void cleanup_module(void)
for (devp = vfc_dev_lst; *devp; devp++) for (devp = vfc_dev_lst; *devp; devp++)
deinit_vfc_device(*devp); deinit_vfc_device(*devp);
devfs_unregister (devfs_handle); devfs_remove("vfc");
kfree(vfc_dev_lst); kfree(vfc_dev_lst);
return; return;
} }
......
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