summaryrefslogtreecommitdiff
path: root/drivers/parport/procfs.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-05-20 18:26:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 01:08:18 +0300
commit6fa45a22689722dac9f0e90c0931d4b34b334ede (patch)
treed3f766b8771a0004cb21690b55e75f0ce1aba014 /drivers/parport/procfs.c
parent208250dd4c3dd54963db85340cdc5e4c2acef5b5 (diff)
downloadlinux-6fa45a22689722dac9f0e90c0931d4b34b334ede.tar.xz
parport: add device-model to parport subsystem
parport subsystem starts using the device-model. Drivers using the device-model has to define devmodel as true and should register the device with parport using parport_register_dev_model(). Tested-by: Jean Delvare <jdelvare@suse.de> Tested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport/procfs.c')
-rw-r--r--drivers/parport/procfs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 3b470801a04f..c776333a68bc 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -21,6 +21,7 @@
#include <linux/parport.h>
#include <linux/ctype.h>
#include <linux/sysctl.h>
+#include <linux/device.h>
#include <asm/uaccess.h>
@@ -558,8 +559,18 @@ int parport_device_proc_unregister(struct pardevice *device)
static int __init parport_default_proc_register(void)
{
+ int ret;
+
parport_default_sysctl_table.sysctl_header =
register_sysctl_table(parport_default_sysctl_table.dev_dir);
+ if (!parport_default_sysctl_table.sysctl_header)
+ return -ENOMEM;
+ ret = parport_bus_init();
+ if (ret) {
+ unregister_sysctl_table(parport_default_sysctl_table.
+ sysctl_header);
+ return ret;
+ }
return 0;
}
@@ -570,6 +581,7 @@ static void __exit parport_default_proc_unregister(void)
sysctl_header);
parport_default_sysctl_table.sysctl_header = NULL;
}
+ parport_bus_exit();
}
#else /* no sysctl or no procfs*/
@@ -596,11 +608,12 @@ int parport_device_proc_unregister(struct pardevice *device)
static int __init parport_default_proc_register (void)
{
- return 0;
+ return parport_bus_init();
}
static void __exit parport_default_proc_unregister (void)
{
+ parport_bus_exit();
}
#endif