Skip to content

Commit f924224

Browse files
jhovoldUlf Hansson
authored andcommitted
mmc: vub300: clean up module init
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>
1 parent 5b8b35d commit f924224

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

drivers/mmc/host/vub300.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,37 +2429,36 @@ static int __init vub300_init(void)
24292429

24302430
pr_info("VUB300 Driver rom wait states = %02X irqpoll timeout = %04X",
24312431
firmware_rom_wait_states, 0x0FFFF & firmware_irqpoll_timeout);
2432+
24322433
cmndworkqueue = create_singlethread_workqueue("kvub300c");
2433-
if (!cmndworkqueue) {
2434-
pr_err("not enough memory for the REQUEST workqueue");
2435-
result = -ENOMEM;
2436-
goto out1;
2437-
}
2434+
if (!cmndworkqueue)
2435+
return -ENOMEM;
2436+
24382437
pollworkqueue = create_singlethread_workqueue("kvub300p");
24392438
if (!pollworkqueue) {
2440-
pr_err("not enough memory for the IRQPOLL workqueue");
24412439
result = -ENOMEM;
2442-
goto out2;
2440+
goto err_destroy_cmdwq;
24432441
}
2442+
24442443
deadworkqueue = create_singlethread_workqueue("kvub300d");
24452444
if (!deadworkqueue) {
2446-
pr_err("not enough memory for the EXPIRED workqueue");
24472445
result = -ENOMEM;
2448-
goto out3;
2446+
goto err_destroy_pollwq;
24492447
}
2448+
24502449
result = usb_register(&vub300_driver);
2451-
if (result) {
2452-
pr_err("usb_register failed. Error number %d", result);
2453-
goto out4;
2454-
}
2450+
if (result)
2451+
goto err_destroy_deadwq;
2452+
24552453
return 0;
2456-
out4:
2454+
2455+
err_destroy_deadwq:
24572456
destroy_workqueue(deadworkqueue);
2458-
out3:
2457+
err_destroy_pollwq:
24592458
destroy_workqueue(pollworkqueue);
2460-
out2:
2459+
err_destroy_cmdwq:
24612460
destroy_workqueue(cmndworkqueue);
2462-
out1:
2461+
24632462
return result;
24642463
}
24652464

0 commit comments

Comments
 (0)