Commit dc98e25b authored by Tzung-Bi Shih's avatar Tzung-Bi Shih Committed by Lee Jones

mfd: cros_ec: Simplify and clean-up cros_ec_dev_init()

Simplify cros_ec_dev_init() by the following changes:
- Get rid of label `failed_devreg`.
- Remove a redundant space and comment.
- Use `if (ret)` instead of `if (ret < 0)`.
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240819102326.5235-1-tzungbi@kernel.orgSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 607638b7
......@@ -353,22 +353,17 @@ static int __init cros_ec_dev_init(void)
{
int ret;
ret = class_register(&cros_class);
ret = class_register(&cros_class);
if (ret) {
pr_err(CROS_EC_DEV_NAME ": failed to register device class\n");
return ret;
}
/* Register the driver */
ret = platform_driver_register(&cros_ec_dev_driver);
if (ret < 0) {
if (ret) {
pr_warn(CROS_EC_DEV_NAME ": can't register driver: %d\n", ret);
goto failed_devreg;
class_unregister(&cros_class);
}
return 0;
failed_devreg:
class_unregister(&cros_class);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment