Merge tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / panel / panel.c
index d670494552531170366d91b266e4501a775a1327..bda208da514e3b5b96da3ad06d7beeda659a8651 100644 (file)
@@ -2188,6 +2188,8 @@ static struct notifier_block panel_notifier = {
 
 static void panel_attach(struct parport *port)
 {
+       struct pardev_cb panel_cb;
+
        if (port->number != parport)
                return;
 
@@ -2197,10 +2199,11 @@ static void panel_attach(struct parport *port)
                return;
        }
 
-       pprt = parport_register_device(port, "panel", NULL, NULL,  /* pf, kf */
-                                      NULL,
-                                      /*PARPORT_DEV_EXCL */
-                                      0, (void *)&pprt);
+       memset(&panel_cb, 0, sizeof(panel_cb));
+       panel_cb.private = &pprt;
+       /* panel_cb.flags = 0 should be PARPORT_DEV_EXCL? */
+
+       pprt = parport_register_dev_model(port, "panel", &panel_cb, 0);
        if (pprt == NULL) {
                pr_err("%s: port->number=%d parport=%d, parport_register_device() failed\n",
                       __func__, port->number, parport);
@@ -2274,8 +2277,9 @@ static void panel_detach(struct parport *port)
 
 static struct parport_driver panel_driver = {
        .name = "panel",
-       .attach = panel_attach,
+       .match_port = panel_attach,
        .detach = panel_detach,
+       .devmodel = true,
 };
 
 /* init function */