Skip to content

Commit

Permalink
Input: tnetv107x-ts - don't treat NULL clk as an error
Browse files Browse the repository at this point in the history
We should use IS_ERR() when checking whether clk_get() succeeded or
not since it returns errors by encoding error codes with ERR_PTR().

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Jamie Iles authored and Dmitry Torokhov committed Jan 18, 2011
1 parent a064092 commit ba55546
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/touchscreen/tnetv107x-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/input.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -289,9 +290,9 @@ static int __devinit tsc_probe(struct platform_device *pdev)
}

ts->clk = clk_get(dev, NULL);
if (!ts->clk) {
if (IS_ERR(ts->clk)) {
dev_err(dev, "cannot claim device clock\n");
error = -EINVAL;
error = PTR_ERR(ts->clk);
goto error_clk;
}

Expand Down

0 comments on commit ba55546

Please sign in to comment.