Lines Matching refs:ms_gdev
94 void ms_device_bind_driver(struct device_s * ms_gdev) in ms_device_bind_driver() argument
97 ms_gdev->bus_id,ms_gdev->driver->name); in ms_device_bind_driver()
98 ms_insert_list_before(&ms_gdev->driver_list,&ms_gdev->driver->devices); in ms_device_bind_driver()
109 static int ms_bus_match(struct device_s * ms_gdev, struct device_driver * ms_drv) in ms_bus_match() argument
114 if (ms_gdev->bus_type->match_func(ms_gdev,ms_drv)) in ms_bus_match()
116 ms_gdev->driver = ms_drv; in ms_bus_match()
120 if ((ms_err = ms_drv->probe(ms_gdev))) in ms_bus_match()
122 ms_gdev->driver = NULL; in ms_bus_match()
126 ms_device_bind_driver(ms_gdev); in ms_bus_match()
140 static int ms_device_attach(struct device_s * ms_gdev) in ms_device_attach() argument
142 struct ms_bus_type * ms_bus = ms_gdev->bus_type; in ms_device_attach()
147 if (ms_gdev->driver) in ms_device_attach()
149 ms_device_bind_driver(ms_gdev); in ms_device_attach()
159 if (!ms_bus_match(ms_gdev,ms_drv)) in ms_device_attach()
178 struct device_s * ms_gdev; in ms_driver_attach() local
187 ms_gdev = (struct device_s *)((char *)_mtr - (char *)offsetof(struct device_s, bus_list) ); in ms_driver_attach()
188 if (!ms_gdev->driver) in ms_driver_attach()
190 ms_bus_match(ms_gdev,ms_drv); in ms_driver_attach()
202 void ms_device_release_driver(struct device_s * ms_gdev) in ms_device_release_driver() argument
204 struct device_driver * ms_drv = ms_gdev->driver; in ms_device_release_driver()
208 ms_list_remove_and_init(&ms_gdev->driver_list); in ms_device_release_driver()
210 ms_drv->remove(ms_gdev); in ms_device_release_driver()
211 ms_gdev->driver = NULL; in ms_device_release_driver()
225 struct device_s *ms_gdev; in ms_driver_detach() local
232 … ms_gdev = (struct device_s *)( (char *)_mptr - (char *)offsetof(struct device_s, driver_list) ); in ms_driver_detach()
233 ms_device_release_driver(ms_gdev); in ms_driver_detach()
244 int ms_bus_add_device(struct device_s * ms_gdev) in ms_bus_add_device() argument
248 if (ms_gdev->bus_type) in ms_bus_add_device()
250 ms_usbhost_debug("bus USB: add device %s\n",ms_gdev->bus_id); in ms_bus_add_device()
251 ms_insert_list_before(&ms_gdev->bus_list,&ms_gdev->bus_type->devices_list); in ms_bus_add_device()
252 ms_device_attach(ms_gdev); in ms_bus_add_device()
264 void ms_bus_remove_device(struct device_s * ms_gdev) in ms_bus_remove_device() argument
266 if (ms_gdev->bus_type) in ms_bus_remove_device()
268 ms_usbhost_debug("bus USB: remove device %s\n",ms_gdev->bus_id); in ms_bus_remove_device()
269 ms_device_release_driver(ms_gdev); in ms_bus_remove_device()
270 ms_list_remove_and_init(&ms_gdev->bus_list); in ms_bus_remove_device()