* [PATCH RESEND] tc: account for device_register() failure
@ 2014-04-02 10:00 Levente Kurusa
0 siblings, 0 replies; only message in thread
From: Levente Kurusa @ 2014-04-02 10:00 UTC (permalink / raw)
To: Maciej W. Rozycki, Ralf Baechle; +Cc: LKML, Linux MIPS, Levente Kurusa
This patch makes the TURBOchannel driver bail out if the call
to device_register() failed.
Signed-off-by: Levente Kurusa <levex@linux.com>
---
Resending as per Maciej's request to proper list and
people.
---
tc.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tc/tc.c b/drivers/tc/tc.c
index a8aaf6a..6b3a038 100644
--- a/drivers/tc/tc.c
+++ b/drivers/tc/tc.c
@@ -129,7 +129,10 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus)
tc_device_get_irq(tdev);
- device_register(&tdev->dev);
+ if (device_register(&tdev->dev)) {
+ put_device(&tdev->dev);
+ goto out_err;
+ }
list_add_tail(&tdev->node, &tbus->devices);
out_err:
@@ -148,7 +151,10 @@ static int __init tc_init(void)
INIT_LIST_HEAD(&tc_bus.devices);
dev_set_name(&tc_bus.dev, "tc");
- device_register(&tc_bus.dev);
+ if (device_register(&tc_bus.dev)) {
+ put_device(&tc_bus.dev);
+ return 0;
+ }
if (tc_bus.info.slot_size) {
unsigned int tc_clock = tc_get_speed(&tc_bus) / 100000;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-02 10:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 10:00 [PATCH RESEND] tc: account for device_register() failure Levente Kurusa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®