From patchwork Thu Aug 9 11:11:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1299821 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3E2783FC23 for ; Thu, 9 Aug 2012 11:11:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757973Ab2HILLh (ORCPT ); Thu, 9 Aug 2012 07:11:37 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:60693 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757922Ab2HILLg (ORCPT ); Thu, 9 Aug 2012 07:11:36 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q79BBY6B024234; Thu, 9 Aug 2012 06:11:35 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q79BBXtY013775; Thu, 9 Aug 2012 16:41:33 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Thu, 9 Aug 2012 16:41:33 +0530 Received: from ula0393217.india.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q79BBWeN007686; Thu, 9 Aug 2012 16:41:33 +0530 From: Shubhrajyoti D To: CC: , Shubhrajyoti D Subject: [PATCH] Input: omap4-keypad: Fix the pm_runtime_get_sync return check Date: Thu, 9 Aug 2012 16:41:30 +0530 Message-ID: <1344510690-13030-1-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org A non-zero on pm_runtime_get_sync shouldnt be considered as an error it only means that there was another user. Fix the error check to check for negative values only. This should fix issues like below [ 917.049713] omap4-keypad omap4-keypad: pm_runtime_get_sync() failed [ 917.056457] omap4-keypad: probe of omap4-keypad failed with error 1 Signed-off-by: Shubhrajyoti D --- drivers/input/keyboard/omap4-keypad.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 17efede..34cddaf 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -305,8 +305,8 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev) */ pm_runtime_enable(&pdev->dev); error = pm_runtime_get_sync(&pdev->dev); - if (error) { - dev_err(&pdev->dev, "pm_runtime_get_sync() failed\n"); + if (IS_ERR_VALUE(error)) { + dev_err(&pdev->dev, "pm_runtime_get_sync() failed %d\n", error); goto err_unmap; } rev = __raw_readl(keypad_data->base + OMAP4_KBD_REVISION);