diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2024-08-19 18:23:26 +0800 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2024-09-23 16:20:53 +0100 |
commit | dc98e25bc37b9674f7984b88d04793f466734728 (patch) | |
tree | 9f79bfee30502a1fde415b49aaaa25d41c860f2c /drivers/mfd | |
parent | 607638b73cb097e727b19e4c09f2c68bddae941e (diff) |
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: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240819102326.5235-1-tzungbi@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/cros_ec_dev.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index e2aae8918679..55b30076763b 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -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; } |