Skip to content

Commit

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

Signed-off-by: Sudip Mukherjee <[email protected]>
Acked-by: Rodolfo Giometti <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Mar 14, 2018
1 parent fb56d97 commit b857cac
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/pps/generators/pps_gen_parport.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,18 @@ static inline ktime_t next_intr_time(struct pps_generator_pp *dev)

static void parport_attach(struct parport *port)
{
struct pardev_cb pps_cb;

if (attached) {
/* we already have a port */
return;
}

device.pardev = parport_register_device(port, KBUILD_MODNAME,
NULL, NULL, NULL, PARPORT_FLAG_EXCL, &device);
memset(&pps_cb, 0, sizeof(pps_cb));
pps_cb.private = &device;
pps_cb.flags = PARPORT_FLAG_EXCL;
device.pardev = parport_register_dev_model(port, KBUILD_MODNAME,
&pps_cb, 0);
if (!device.pardev) {
pr_err("couldn't register with %s\n", port->name);
return;
Expand Down Expand Up @@ -236,8 +241,9 @@ static void parport_detach(struct parport *port)

static struct parport_driver pps_gen_parport_driver = {
.name = KBUILD_MODNAME,
.attach = parport_attach,
.match_port = parport_attach,
.detach = parport_detach,
.devmodel = true,
};

/* module staff */
Expand Down

0 comments on commit b857cac

Please sign in to comment.