Lines Matching defs:drv
748 struct platform_driver *drv = to_platform_driver(_dev->driver);
760 if (drv->probe) {
761 ret = drv->probe(dev);
767 if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
782 struct platform_driver *drv = to_platform_driver(_dev->driver);
786 if (drv->remove)
787 ret = drv->remove(dev);
795 struct platform_driver *drv = to_platform_driver(_dev->driver);
798 if (drv->shutdown)
799 drv->shutdown(dev);
804 * @drv: platform driver structure
807 int __platform_driver_register(struct platform_driver *drv,
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);
822 * @drv: platform driver structure
824 void platform_driver_unregister(struct platform_driver *drv)
826 driver_unregister(&drv->driver);
832 * @drv: platform driver structure
850 int __init_or_module __platform_driver_probe(struct platform_driver *drv,
855 if (drv->driver.probe_type == PROBE_PREFER_ASYNCHRONOUS) {
857 drv->driver.name, __func__);
866 drv->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
872 drv->prevent_deferred_probe = true;
875 drv->driver.suppress_bind_attrs = true;
878 drv->probe = probe;
879 retval = code = __platform_driver_register(drv, module);
889 spin_lock(&drv->driver.bus->p->klist_drivers.k_lock);
890 drv->probe = NULL;
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);
897 platform_driver_unregister(drv);
1140 * @drv: driver.
1150 static int platform_match(struct device *dev, struct device_driver *drv)
1153 struct platform_driver *pdrv = to_platform_driver(drv);
1157 return !strcmp(pdev->driver_override, drv->name);
1160 if (of_driver_match_device(dev, drv))
1164 if (acpi_driver_match_device(dev, drv))
1172 return (strcmp(pdev->name, drv->name) == 0);
1207 struct device_driver *drv = dev->driver;
1210 if (!drv)
1213 if (drv->pm) {
1214 if (drv->pm->suspend)
1215 ret = drv->pm->suspend(dev);
1225 struct device_driver *drv = dev->driver;
1228 if (!drv)
1231 if (drv->pm) {
1232 if (drv->pm->resume)
1233 ret = drv->pm->resume(dev);
1247 struct device_driver *drv = dev->driver;
1250 if (!drv)
1253 if (drv->pm) {
1254 if (drv->pm->freeze)
1255 ret = drv->pm->freeze(dev);
1265 struct device_driver *drv = dev->driver;
1268 if (!drv)
1271 if (drv->pm) {
1272 if (drv->pm->thaw)
1273 ret = drv->pm->thaw(dev);
1283 struct device_driver *drv = dev->driver;
1286 if (!drv)
1289 if (drv->pm) {
1290 if (drv->pm->poweroff)
1291 ret = drv->pm->poweroff(dev);
1301 struct device_driver *drv = dev->driver;
1304 if (!drv)
1307 if (drv->pm) {
1308 if (drv->pm->restore)
1309 ret = drv->pm->restore(dev);
1350 static inline int __platform_match(struct device *dev, const void *drv)
1352 return platform_match(dev, (struct device_driver *)drv);
1359 * @drv: The device driver to look for.
1362 const struct device_driver *drv)
1364 return bus_find_device(&platform_bus_type, start, drv,