Lines Matching defs:drv
40 static void serio_attach_driver(struct serio_driver *drv);
42 static int serio_connect_driver(struct serio *serio, struct serio_driver *drv)
47 retval = drv->connect(serio, drv);
58 if (serio->drv && serio->drv->reconnect)
59 retval = serio->drv->reconnect(serio);
68 if (serio->drv)
69 serio->drv->disconnect(serio);
90 static int serio_bind_driver(struct serio *serio, struct serio_driver *drv)
94 if (serio_match_port(drv->id_table, serio)) {
96 serio->dev.driver = &drv->driver;
97 if (serio_connect_driver(serio, drv)) {
107 drv->description, error);
385 struct device_driver *drv;
400 } else if ((drv = driver_find(buf, &serio_bus)) != NULL) {
402 error = serio_bind_driver(serio, to_serio_driver(drv));
735 static ssize_t description_show(struct device_driver *drv, char *buf)
737 struct serio_driver *driver = to_serio_driver(drv);
742 static ssize_t bind_mode_show(struct device_driver *drv, char *buf)
744 struct serio_driver *serio_drv = to_serio_driver(drv);
748 static ssize_t bind_mode_store(struct device_driver *drv, const char *buf, size_t count)
750 struct serio_driver *serio_drv = to_serio_driver(drv);
776 struct serio_driver *drv = to_serio_driver(dev->driver);
778 return serio_connect_driver(serio, drv);
792 if (serio->drv && serio->drv->cleanup)
793 serio->drv->cleanup(serio);
804 static void serio_attach_driver(struct serio_driver *drv)
808 error = driver_attach(&drv->driver);
811 drv->driver.name, error);
814 int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name)
816 bool manual_bind = drv->manual_bind;
819 drv->driver.bus = &serio_bus;
820 drv->driver.owner = owner;
821 drv->driver.mod_name = mod_name;
827 drv->manual_bind = true;
829 error = driver_register(&drv->driver);
832 drv->driver.name, error);
841 drv->manual_bind = false;
842 error = serio_queue_event(drv, NULL, SERIO_ATTACH_DRIVER);
844 driver_unregister(&drv->driver);
853 void serio_unregister_driver(struct serio_driver *drv)
859 drv->manual_bind = true; /* so serio_find_driver ignores it */
860 serio_remove_pending_events(drv);
864 if (serio->drv == drv) {
872 driver_unregister(&drv->driver);
877 static void serio_set_drv(struct serio *serio, struct serio_driver *drv)
880 serio->drv = drv;
884 static int serio_bus_match(struct device *dev, struct device_driver *drv)
887 struct serio_driver *serio_drv = to_serio_driver(drv);
943 if (serio->drv && serio->drv->fast_reconnect) {
944 error = serio->drv->fast_reconnect(serio);
971 int serio_open(struct serio *serio, struct serio_driver *drv)
973 serio_set_drv(serio, drv);
1001 if (likely(serio->drv)) {
1002 ret = serio->drv->interrupt(serio, data, dfl);