Skip to content

Commit

Permalink
Input: tnetv107x-keypad - 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 01c728a commit a064092
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/input/keyboard/tnetv107x-keypad.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 @@ -219,9 +220,9 @@ static int __devinit keypad_probe(struct platform_device *pdev)
}

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

Expand Down

0 comments on commit a064092

Please sign in to comment.