From 644a9d3b66e6983c2c1f3b24c3006d49b184c871 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 16 Nov 2012 17:17:50 +0800 Subject: misc: apds9802als: Fix the logic checking timeout in als_wait_for_data_ready() In the case of timeout waiting for data ready, the retry variable is -1. This also fixes a bug: current code returns -ETIMEDOUT if latest retry success ( which means retry is 0 when exiting the while loop ). Signed-off-by: Axel Lin Signed-off-by: Greg Kroah-Hartman --- drivers/misc/apds9802als.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc/apds9802als.c') diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0314773f6db3..94923d259910 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -68,7 +68,7 @@ static int als_wait_for_data_ready(struct device *dev) ret = i2c_smbus_read_byte_data(client, 0x86); } while (!(ret & 0x80) && retry--); - if (!retry) { + if (retry < 0) { dev_warn(dev, "timeout waiting for data ready\n"); return -ETIMEDOUT; } -- cgit v1.2.3 From 2d6bed9ca93e98685bc5038d686984fd449cd978 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 19 Nov 2012 13:21:23 -0500 Subject: drivers/misc: remove use of __devexit_p MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton Cc: "Michał Mirosław" Cc: Wolfram Sang Cc: Eric Piel Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/misc/apds9802als.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc/apds9802als.c') diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 94923d259910..0132d15a995c 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -326,7 +326,7 @@ static struct i2c_driver apds9802als_driver = { .pm = APDS9802ALS_PM_OPS, }, .probe = apds9802als_probe, - .remove = __devexit_p(apds9802als_remove), + .remove = apds9802als_remove, .suspend = apds9802als_suspend, .resume = apds9802als_resume, .id_table = apds9802als_id, -- cgit v1.2.3 From 486a5c28c2e7d6a80c393ac7d612b77d80447b84 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Mon, 19 Nov 2012 13:26:02 -0500 Subject: misc: remove use of __devexit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton Cc: "Michał Mirosław" Cc: Wolfram Sang Cc: Eric Piel Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/misc/apds9802als.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc/apds9802als.c') diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index 0132d15a995c..d648b0893027 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -254,7 +254,7 @@ als_error1: return res; } -static int __devexit apds9802als_remove(struct i2c_client *client) +static int apds9802als_remove(struct i2c_client *client) { struct als_data *data = i2c_get_clientdata(client); -- cgit v1.2.3