Lines Matching defs:driver
8 * Please see Documentation/driver-api/driver-model/platform.rst for more
748 struct platform_driver *drv = to_platform_driver(_dev->driver);
782 struct platform_driver *drv = to_platform_driver(_dev->driver);
795 struct platform_driver *drv = to_platform_driver(_dev->driver);
803 * __platform_driver_register - register a driver for platform-level devices
804 * @drv: platform driver structure
805 * @owner: owning module/driver
810 drv->driver.owner = owner;
811 drv->driver.bus = &platform_bus_type;
812 drv->driver.probe = platform_drv_probe;
813 drv->driver.remove = platform_drv_remove;
814 drv->driver.shutdown = platform_drv_shutdown;
816 return driver_register(&drv->driver);
821 * platform_driver_unregister - unregister a driver for platform-level devices
822 * @drv: platform driver structure
826 driver_unregister(&drv->driver);
831 * __platform_driver_probe - register driver for non-hotpluggable device
832 * @drv: platform driver structure
833 * @probe: the driver probe routine, probably from an __init section
834 * @module: module which will be the owner of the driver
838 * remove its run-once probe() infrastructure from memory after the driver
847 * Returns zero if the driver registered and bound to a device, else returns
848 * a negative error code and with the driver not registered.
855 if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) {
857 drv->driver.name, __func__);
866 drv->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
869 * Prevent driver from requesting probe deferral to avoid further
874 /* make sure driver won't have bind/unbind attributes */
875 drv->driver.suppress_bind_attrs = true;
889 spin_lock(&drv->driver.bus->p->klist_drivers.k_lock);
891 if (code == 0 && list_empty(&drv->driver.p->klist_devices.k_list))
893 drv->driver.probe = platform_drv_probe_fail;
894 spin_unlock(&drv->driver.bus->p->klist_drivers.k_lock);
903 * __platform_create_bundle - register driver and create corresponding device
904 * @driver: platform driver structure
905 * @probe: the driver probe routine, probably from an __init section
910 * @module: module which will be the owner of the driver
913 * register a single platform device and corresponding platform driver.
918 struct platform_driver *driver,
926 pdev = platform_device_alloc(driver->driver.name, -1);
944 error = __platform_driver_probe(driver, probe, module);
966 * driver, all previously registered drivers will be unregistered. Callers of
979 pr_debug("registering platform driver %ps\n", drivers[i]);
983 pr_err("failed to register platform driver %ps: %d\n",
993 pr_debug("unregistering platform driver %ps\n", drivers[i]);
1014 pr_debug("unregistering platform driver %ps\n", drivers[count]);
1138 * platform_match - bind platform device to platform driver.
1140 * @drv: driver.
1147 * and compare it against the name of the driver. Return whether they match
1155 /* When driver_override is set, only bind to the matching driver */
1171 /* fall-back to driver name match */
1179 struct platform_driver *pdrv = to_platform_driver(dev->driver);
1183 if (dev->driver && pdrv->suspend)
1191 struct platform_driver *pdrv = to_platform_driver(dev->driver);
1195 if (dev->driver && pdrv->resume)
1207 struct device_driver *drv = dev->driver;
1225 struct device_driver *drv = dev->driver;
1247 struct device_driver *drv = dev->driver;
1265 struct device_driver *drv = dev->driver;
1283 struct device_driver *drv = dev->driver;
1301 struct device_driver *drv = dev->driver;
1357 * driver.
1359 * @drv: The device driver to look for.