From: Paul Mundt Date: Tue, 6 Nov 2007 09:05:08 +0000 (+0900) Subject: superhyway: Handle device_register() retval properly. X-Git-Tag: v2.6.24-rc3~171^2~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07782cec9b444746859855fc310f20f254e995a0;p=linux-2.6 superhyway: Handle device_register() retval properly. Signed-off-by: Paul Mundt --- diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c index 7d873b3b05..4d0282b821 100644 --- a/drivers/sh/superhyway/superhyway.c +++ b/drivers/sh/superhyway/superhyway.c @@ -107,16 +107,17 @@ int superhyway_add_devices(struct superhyway_bus *bus, static int __init superhyway_init(void) { struct superhyway_bus *bus; - int ret = 0; + int ret; - device_register(&superhyway_bus_device); + ret = device_register(&superhyway_bus_device); + if (unlikely(ret)) + return ret; for (bus = superhyway_channels; bus->ops; bus++) ret |= superhyway_scan_bus(bus); return ret; } - postcore_initcall(superhyway_init); static const struct superhyway_device_id *