Skip to content

Commit

Permalink
char: lp: use new parport device model
Browse files Browse the repository at this point in the history
Modify lp driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Dec 19, 2018
1 parent e379c1a commit fdfaef2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fdfaef2

Please sign in to comment.