]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mmc: vub300: clean up module init
authorJohan Hovold <johan@kernel.org>
Fri, 27 Mar 2026 10:52:08 +0000 (11:52 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 31 Mar 2026 11:13:47 +0000 (13:13 +0200)
Clean up module init by dropping redundant error messages (e.g.
allocation and USB driver registration failure will already have been
logged) and naming error labels after what they do.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/vub300.c

index 3057a69ff8c48481422afadad15a8be56aec3eac..6c3cb2f1c9d32bbb3daf16bb55767aaef28b9160 100644 (file)
@@ -2429,37 +2429,36 @@ static int __init vub300_init(void)
 
        pr_info("VUB300 Driver rom wait states = %02X irqpoll timeout = %04X",
                firmware_rom_wait_states, 0x0FFFF & firmware_irqpoll_timeout);
+
        cmndworkqueue = create_singlethread_workqueue("kvub300c");
-       if (!cmndworkqueue) {
-               pr_err("not enough memory for the REQUEST workqueue");
-               result = -ENOMEM;
-               goto out1;
-       }
+       if (!cmndworkqueue)
+               return -ENOMEM;
+
        pollworkqueue = create_singlethread_workqueue("kvub300p");
        if (!pollworkqueue) {
-               pr_err("not enough memory for the IRQPOLL workqueue");
                result = -ENOMEM;
-               goto out2;
+               goto err_destroy_cmdwq;
        }
+
        deadworkqueue = create_singlethread_workqueue("kvub300d");
        if (!deadworkqueue) {
-               pr_err("not enough memory for the EXPIRED workqueue");
                result = -ENOMEM;
-               goto out3;
+               goto err_destroy_pollwq;
        }
+
        result = usb_register(&vub300_driver);
-       if (result) {
-               pr_err("usb_register failed. Error number %d", result);
-               goto out4;
-       }
+       if (result)
+               goto err_destroy_deadwq;
+
        return 0;
-out4:
+
+err_destroy_deadwq:
        destroy_workqueue(deadworkqueue);
-out3:
+err_destroy_pollwq:
        destroy_workqueue(pollworkqueue);
-out2:
+err_destroy_cmdwq:
        destroy_workqueue(cmndworkqueue);
-out1:
+
        return result;
 }