Lines Matching refs:driver
8 * Please see Documentation/driver-api/driver-model/platform.rst for more
857 * __platform_driver_register - register a driver for platform-level devices
858 * @drv: platform driver structure
859 * @owner: owning module/driver
864 drv->driver.owner = owner;
865 drv->driver.bus = &platform_bus_type;
867 return driver_register(&drv->driver);
872 * platform_driver_unregister - unregister a driver for platform-level devices
873 * @drv: platform driver structure
877 driver_unregister(&drv->driver);
886 static int is_bound_to_driver(struct device *dev, void *driver)
888 if (dev->driver == driver)
894 * __platform_driver_probe - register driver for non-hotpluggable device
895 * @drv: platform driver structure
896 * @probe: the driver probe routine, probably from an __init section
897 * @module: module which will be the owner of the driver
901 * remove its run-once probe() infrastructure from memory after the driver
910 * Returns zero if the driver registered and bound to a device, else returns
911 * a negative error code and with the driver not registered.
918 if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) {
920 drv->driver.name, __func__);
929 drv->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
932 * Prevent driver from requesting probe deferral to avoid further
937 /* make sure driver won't have bind/unbind attributes */
938 drv->driver.suppress_bind_attrs = true;
946 /* Force all new probes of this driver to fail */
949 /* Walk all platform devices and see if any actually bound to this driver.
952 if (!bus_for_each_dev(&platform_bus_type, NULL, &drv->driver, is_bound_to_driver)) {
962 * __platform_create_bundle - register driver and create corresponding device
963 * @driver: platform driver structure
964 * @probe: the driver probe routine, probably from an __init section
969 * @module: module which will be the owner of the driver
972 * register a single platform device and corresponding platform driver.
977 struct platform_driver *driver,
985 pdev = platform_device_alloc(driver->driver.name, -1);
1003 error = __platform_driver_probe(driver, probe, module);
1025 * driver, all previously registered drivers will be unregistered. Callers of
1038 pr_debug("registering platform driver %ps\n", drivers[i]);
1042 pr_err("failed to register platform driver %ps: %d\n",
1052 pr_debug("unregistering platform driver %ps\n", drivers[i]);
1073 pr_debug("unregistering platform driver %ps\n", drivers[count]);
1097 struct platform_driver *pdrv = to_platform_driver(dev->driver);
1101 if (dev->driver && pdrv->suspend)
1109 struct platform_driver *pdrv = to_platform_driver(dev->driver);
1113 if (dev->driver && pdrv->resume)
1125 struct device_driver *drv = dev->driver;
1143 struct device_driver *drv = dev->driver;
1165 struct device_driver *drv = dev->driver;
1183 struct device_driver *drv = dev->driver;
1201 struct device_driver *drv = dev->driver;
1219 struct device_driver *drv = dev->driver;
1323 * platform_match - bind platform device to platform driver.
1325 * @drv: driver.
1332 * and compare it against the name of the driver. Return whether they match
1340 /* When driver_override is set, only bind to the matching driver */
1356 /* fall-back to driver name match */
1381 struct platform_driver *drv = to_platform_driver(_dev->driver);
1386 * A driver registered using platform_driver_probe() cannot be bound
1420 struct platform_driver *drv = to_platform_driver(_dev->driver);
1439 if (!_dev->driver)
1442 drv = to_platform_driver(_dev->driver);
1449 struct platform_driver *drv = to_platform_driver(dev->driver);
1471 struct platform_driver *drv = to_platform_driver(dev->driver);
1503 * driver.
1505 * @drv: The device driver to look for.