greybus: svc: clean up hello error path
While currently safe, it is unnecessary (and confusing) to try to destroy the watchdog when watchdog creation fails. Change the corresponding error path to only deregister the svc. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220202113347.1288-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5f8583a3b7
commit
5f648e00f5
|
@ -861,7 +861,7 @@ static int gb_svc_hello(struct gb_operation *op)
|
||||||
ret = gb_svc_watchdog_create(svc);
|
ret = gb_svc_watchdog_create(svc);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&svc->dev, "failed to create watchdog: %d\n", ret);
|
dev_err(&svc->dev, "failed to create watchdog: %d\n", ret);
|
||||||
goto err_unregister_device;
|
goto err_deregister_svc;
|
||||||
}
|
}
|
||||||
|
|
||||||
gb_svc_debugfs_init(svc);
|
gb_svc_debugfs_init(svc);
|
||||||
|
@ -874,9 +874,10 @@ static int gb_svc_hello(struct gb_operation *op)
|
||||||
|
|
||||||
err_remove_debugfs:
|
err_remove_debugfs:
|
||||||
gb_svc_debugfs_exit(svc);
|
gb_svc_debugfs_exit(svc);
|
||||||
err_unregister_device:
|
|
||||||
gb_svc_watchdog_destroy(svc);
|
gb_svc_watchdog_destroy(svc);
|
||||||
|
err_deregister_svc:
|
||||||
device_del(&svc->dev);
|
device_del(&svc->dev);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue