summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2018-12-07 14:27:34 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-19 10:40:17 +0100
commitfdfaef212694a139ebd5119f9a07f2e8e24be8a6 (patch)
treecaec1a861578973f538bab5110ef83b09fbc68cb /drivers/char
parente379c1a46068969a2b822a15dbc9a37577e1e04f (diff)
char: lp: use new parport device model
Modify lp driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/lp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index cef2ea386f5e..5c8d780637bd 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -912,9 +912,13 @@ static int __init lp_setup(char *str)
static int lp_register(int nr, struct parport *port)
{
- lp_table[nr].dev = parport_register_device(port, "lp",
- lp_preempt, NULL, NULL, 0,
- (void *) &lp_table[nr]);
+ struct pardev_cb ppdev_cb;
+
+ memset(&ppdev_cb, 0, sizeof(ppdev_cb));
+ ppdev_cb.preempt = lp_preempt;
+ ppdev_cb.private = &lp_table[nr];
+ lp_table[nr].dev = parport_register_dev_model(port, "lp",
+ &ppdev_cb, nr);
if (lp_table[nr].dev == NULL)
return 1;
lp_table[nr].flags |= LP_EXIST;
@@ -1002,8 +1006,9 @@ static void lp_detach(struct parport *port)
static struct parport_driver lp_driver = {
.name = "lp",
- .attach = lp_attach,
+ .match_port = lp_attach,
.detach = lp_detach,
+ .devmodel = true,
};
static int __init lp_init(void)