return retval;
}
+ gb_timesync_schedule_asynchronous(bundle->intf);
+
return 0;
}
goto error_bootrom;
}
+ retval = gb_timesync_init();
+ if (retval) {
+ pr_err("gb_timesync_init failed\n");
+ goto error_timesync;
+ }
return 0; /* Success */
+error_timesync:
+ gb_bootrom_exit();
error_bootrom:
gb_operation_exit();
error_operation:
static void __exit gb_exit(void)
{
+ gb_timesync_exit();
gb_bootrom_exit();
gb_operation_exit();
gb_hd_exit();
if (ret)
goto err_destroy_bundles;
+ ret = gb_timesync_interface_add(intf);
+ if (ret) {
+ dev_err(&intf->dev, "failed to add to timesync: %d\n", ret);
+ goto err_destroy_bundles;
+ }
+
list_for_each_entry_safe_reverse(bundle, tmp, &intf->bundles, links) {
ret = gb_bundle_add(bundle);
if (ret) {
list_for_each_entry_safe(bundle, next, &intf->bundles, links)
gb_bundle_destroy(bundle);
+ gb_timesync_interface_remove(intf);
gb_control_del(intf->control);
gb_control_disable(intf->control);
gb_control_put(intf->control);
ret = gb_svc_watchdog_create(svc);
if (ret) {
dev_err(&svc->dev, "failed to create watchdog: %d\n", ret);
- input_unregister_device(svc->input);
- device_del(&svc->dev);
- return ret;
+ goto err_unregister_device;
}
gb_svc_debugfs_init(svc);
+ ret = gb_timesync_svc_add(svc);
+ if (ret) {
+ dev_err(&svc->dev, "failed to add SVC to timesync: %d\n", ret);
+ gb_svc_debugfs_exit(svc);
+ goto err_unregister_device;
+ }
+
return gb_svc_queue_deferred_request(op);
+
+err_unregister_device:
+ gb_svc_watchdog_destroy(svc);
+ input_unregister_device(svc->input);
+ device_del(&svc->dev);
+ return ret;
}
static struct gb_interface *gb_svc_interface_lookup(struct gb_svc *svc,
* from the request handler.
*/
if (device_is_registered(&svc->dev)) {
+ gb_timesync_svc_remove(svc);
gb_svc_debugfs_exit(svc);
gb_svc_watchdog_destroy(svc);
input_unregister_device(svc->input);