summaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pf.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-05-20 20:57:01 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-01 07:10:23 +0900
commit9f4ba6b05869d085aab03ae84ac3ce0f7685008d (patch)
treed0f52bce6ef9f64654dcf8dd9bfda3c4bfbc152f /drivers/block/paride/pf.c
parent8891f41a78f27fcecf8faa58ca80dfd4bf336bff (diff)
downloadop-kernel-dev-9f4ba6b05869d085aab03ae84ac3ce0f7685008d.zip
op-kernel-dev-9f4ba6b05869d085aab03ae84ac3ce0f7685008d.tar.gz
paride: use new parport device model
Modify paride driver to use the new parallel port device model. 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/block/paride/pf.c')
-rw-r--r--drivers/block/paride/pf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index 9a15fd3..7a7d977 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -264,6 +264,7 @@ static int pf_cmd; /* current command READ/WRITE */
static struct pf_unit *pf_current;/* unit of current request */
static int pf_mask; /* stopper for pseudo-int */
static char *pf_buf; /* buffer for request in progress */
+static void *par_drv; /* reference of parport driver */
/* kernel glue structures */
@@ -703,6 +704,11 @@ static int pf_detect(void)
printk("%s: %s version %s, major %d, cluster %d, nice %d\n",
name, name, PF_VERSION, major, cluster, nice);
+ par_drv = pi_register_driver(name);
+ if (!par_drv) {
+ pr_err("failed to register %s driver\n", name);
+ return -1;
+ }
k = 0;
if (pf_drive_count == 0) {
if (pi_init(pf->pi, 1, -1, -1, -1, -1, -1, pf_scratch, PI_PF,
@@ -735,6 +741,7 @@ static int pf_detect(void)
printk("%s: No ATAPI disk detected\n", name);
for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
put_disk(pf->disk);
+ pi_unregister_driver(par_drv);
return -1;
}
OpenPOWER on IntegriCloud