* [PATCH] dell_rbu: fix error check
@ 2006-11-14 21:18 Akinobu Mita
0 siblings, 0 replies; only message in thread
From: Akinobu Mita @ 2006-11-14 21:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Abhay Salunke
platform_device_register_simple() returns error code as pointer
when it fails. The return value should be checked by IS_ERR().
Cc: Abhay Salunke <abhay_salunke@dell.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
drivers/firmware/dell_rbu.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Index: work-fault-inject/drivers/firmware/dell_rbu.c
===================================================================
--- work-fault-inject.orig/drivers/firmware/dell_rbu.c
+++ work-fault-inject/drivers/firmware/dell_rbu.c
@@ -705,17 +705,16 @@ static struct bin_attribute rbu_packet_s
static int __init dcdrbu_init(void)
{
- int rc = 0;
+ int rc;
spin_lock_init(&rbu_data.lock);
init_packet_head();
- rbu_device =
- platform_device_register_simple("dell_rbu", -1, NULL, 0);
- if (!rbu_device) {
+ rbu_device = platform_device_register_simple("dell_rbu", -1, NULL, 0);
+ if (IS_ERR(rbu_device)) {
printk(KERN_ERR
"dell_rbu:%s:platform_device_register_simple "
"failed\n", __FUNCTION__);
- return -EIO;
+ return PTR_ERR(rbu_device);
}
rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-11-14 21:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-14 21:18 [PATCH] dell_rbu: fix error check Akinobu Mita
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.