From patchwork Thu Mar 27 16:18:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 3898461 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C4684BF540 for ; Thu, 27 Mar 2014 16:19:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 06EBE2010F for ; Thu, 27 Mar 2014 16:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F9CB200F2 for ; Thu, 27 Mar 2014 16:19:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756045AbaC0QSq (ORCPT ); Thu, 27 Mar 2014 12:18:46 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:37720 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755258AbaC0QSp (ORCPT ); Thu, 27 Mar 2014 12:18:45 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2RGIfAi029032; Thu, 27 Mar 2014 11:18:41 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2RGIfx8001975; Thu, 27 Mar 2014 11:18:41 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Thu, 27 Mar 2014 11:18:40 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2RGIf8a006326; Thu, 27 Mar 2014 11:18:41 -0500 From: Nishanth Menon To: Tony Lindgren , Wolfram Sang CC: , , , Nishanth Menon Subject: [PATCH] i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync Date: Thu, 27 Mar 2014 11:18:33 -0500 Message-ID: <1395937113-10222-1-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync, when the value can only be < 0 in the case of err. Replace the check with a simpler < 0 check. This fixes the coccicheck warnings: linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1158 linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 1279 drivers/i2c/busses/i2c-omap.c:638:5-24: pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at line 639 Signed-off-by: Nishanth Menon Reviewed-by: Felipe Balbi --- Patch based on: v3.14-rc8 coccicheck report based on next-20140326 tag drivers/i2c/busses/i2c-omap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 90dcc2e..078a3de 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) int r; r = pm_runtime_get_sync(dev->dev); - if (IS_ERR_VALUE(r)) + if (r < 0) goto out; r = omap_i2c_wait_for_bb(dev); @@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev) pm_runtime_use_autosuspend(dev->dev); r = pm_runtime_get_sync(dev->dev); - if (IS_ERR_VALUE(r)) + if (r < 0) goto err_free_mem; /* @@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev) i2c_del_adapter(&dev->adapter); ret = pm_runtime_get_sync(&pdev->dev); - if (IS_ERR_VALUE(ret)) + if (ret < 0) return ret; omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);