FIX COMPILATION WARNING
authorFei Yang <fei.yang@intel.com>
Sat, 28 Jan 2012 00:39:04 +0000 (16:39 -0800)
committerbuildbot <buildbot@intel.com>
Fri, 3 Feb 2012 22:25:37 +0000 (14:25 -0800)
BZ: 15908

switch_mid.c: In function 'headset_print_state':
switch_mid.c:99: warning: control reaches end of non-void function
switch_mid.c: In function 'headset_print_name':
switch_mid.c:73: warning: control reaches end of non-void function

Change-Id: I35b34c6b4d9f4c05ed6190df5912b046bc5d5e6f
Signed-off-by: Fei Yang <fei.yang@intel.com>
Reviewed-on: http://android.intel.com:8080/33261
Reviewed-by: Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@intel.com>
Reviewed-by: Deng, BingX <bingx.deng@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/switch/switch_mid.c

index f302daa..2b2fc77 100644 (file)
@@ -70,6 +70,8 @@ static ssize_t headset_print_name(struct switch_dev *sdev, char *buf)
 
        if (name)
                return sprintf(buf, "%s\n", name);
+       else
+               return -EINVAL;
 }
 
 static ssize_t headset_print_state(struct switch_dev *sdev, char *buf)
@@ -96,6 +98,8 @@ static ssize_t headset_print_state(struct switch_dev *sdev, char *buf)
 
        if (state)
                return sprintf(buf, "%s\n", state);
+       else
+               return -EINVAL;
 }
 
 static int mid_switch_probe(struct platform_device *pdev)