From: Andrei Warkentin Date: Mon, 6 Dec 2010 22:12:05 +0000 (-0600) Subject: misc: kxtf9: Return success in resume if no enable necessary. X-Git-Tag: firefly_0821_release~9834^2~277 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=97bcb59006b2211229690a9cd9483cff35e879c0;p=firefly-linux-kernel-4.4.55.git misc: kxtf9: Return success in resume if no enable necessary. Resume handler would return -1 if no enabling was necessary. Change-Id: Ia4d21df8f630386b621181935743bb4d7a0f6380 Signed-off-by: Andrei Warkentin --- diff --git a/drivers/misc/kxtf9.c b/drivers/misc/kxtf9.c index 7a4d233fb24c..c9f23094139d 100755 --- a/drivers/misc/kxtf9.c +++ b/drivers/misc/kxtf9.c @@ -1209,14 +1209,15 @@ static int __devexit kxtf9_remove(struct i2c_client *client) static int kxtf9_resume(struct i2c_client *client) { - int err = -1 ; + int err; struct kxtf9_data *tf9 = i2c_get_clientdata(client); - if(tf9->enabled_b4_suspend != 0) { - err = kxtf9_enable(tf9); - if(!err) { - err = kxtf9_update_odr(tf9,tf9->pdata->poll_interval); - } - } + if(!tf9->enabled_b4_suspend) + return 0; + + err = kxtf9_enable(tf9); + if(err) + return err; + err = kxtf9_update_odr(tf9,tf9->pdata->poll_interval); return err; }