diff mbox

[RFC,4/5] input: lid: Fix init function ignores sysfs retval

Message ID 1358366173-56861-5-git-send-email-jeremya@cs.columbia.edu
State Not Applicable, archived
Headers show

Commit Message

Jeremy C. Andrus Jan. 16, 2013, 7:56 p.m. UTC
From: "Jeremy C. Andrus" <jeremya@cs.columbia.edu>

Don't ignore the sysfs_create_group return value in the lid_init()
function. This suppresses a compiler warning and results in more robust
code for free :-)

Signed-off-by: Jeremy C. Andrus <jeremya@cs.columbia.edu>

Change-Id: I2fef38736d39fbd5f60ef5a658f14d917122b942
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Olof Johansson <olof@lixom.net>
---
 drivers/input/lid.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/input/lid.c b/drivers/input/lid.c
index 1d27609..26e3d64 100644
--- a/drivers/input/lid.c
+++ b/drivers/input/lid.c
@@ -163,7 +163,9 @@  static int __init lid_init(void)
                 return -ENOMEM;
         }
 
-	sysfs_create_group((struct kobject*)&lid_dev->dev.kobj, &lid_attr_group);
+	err_code = sysfs_create_group((struct kobject*)&lid_dev->dev.kobj, &lid_attr_group);
+	if (err_code != 0)
+		return err_code;
 
 	err_code = lid_input_device_create();
 	if(err_code != 0)