From patchwork Thu May 2 05:03:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 16565 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A66023942 for ; Thu, 2 May 2013 05:16:32 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id m1sf388990ves.10 for ; Wed, 01 May 2013 22:16:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=HSb6ZIFyQ/KTJqEqV0mXXsw6Drs5AHHzMC5Y//uhyvY=; b=lSsLTbVDj2grEw00AvzQneBxO3cHmmhVUT4Jc4BRX73eXE/IggrkVXsoXfdSnYuvcv dzEBaagEPgcVADzQDoQe5RGgk/Vgu/u+q8sUexBk1DHPSkCmNoE/RGJSa6k4wP9Y1LNa lv8KCGpP7hd5h+F9EZez81obE+c1qkr1RVbONlsnFGlHTSlM/X+rmBwCP8rWBYMzzW+1 Qr4xFczf7JM6PSGuuPwRwLP5afhzl6JaTJP7iY/aDawc/6OYrk0lcmVS0qZ+kbEOHNSx mVwckLbXuPirUN5wiWoM+cbzxfLWZyEC2LBsGSATptVztdBv9tHLPhM1xOqE9nB5W1ZM xb4g== X-Received: by 10.236.70.170 with SMTP id p30mr4437481yhd.5.1367471785188; Wed, 01 May 2013 22:16:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.196 with SMTP id n4ls1016807qev.46.gmail; Wed, 01 May 2013 22:16:25 -0700 (PDT) X-Received: by 10.221.9.136 with SMTP id ow8mr1660473vcb.58.1367471784983; Wed, 01 May 2013 22:16:24 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id ez9si2293842vdb.146.2013.05.01.22.16.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id m16so168298vca.2 for ; Wed, 01 May 2013 22:16:24 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr1723753vec.9.1367471784485; Wed, 01 May 2013 22:16:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp184788veb; Wed, 1 May 2013 22:16:23 -0700 (PDT) X-Received: by 10.66.118.172 with SMTP id kn12mr8023023pab.128.1367471783220; Wed, 01 May 2013 22:16:23 -0700 (PDT) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id tf2si4214889pac.280.2013.05.01.22.16.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id 10so147909pdi.1 for ; Wed, 01 May 2013 22:16:22 -0700 (PDT) X-Received: by 10.66.174.143 with SMTP id bs15mr8218553pac.17.1367471782531; Wed, 01 May 2013 22:16:22 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id fx2sm6710367pac.4.2013.05.01.22.16.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:21 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v2 1/2] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in hdmi_drv.c Date: Thu, 2 May 2013 10:33:28 +0530 Message-Id: <1367471009-7103-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQklz6cQlEkIFvD1sgUIDJxrk3pyTqXQEPPYLF4pppI9QMMzkp1zQD0aUzzRvnYcE5ZLNTeJ X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , NULL check on clocks obtained using common clock APIs should not be done. Use IS_ERR only. Signed-off-by: Sachin Kamat --- Changes since v1: Initialised clocks to invalid value. --- drivers/media/platform/s5p-tv/hdmi_drv.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 4e86626..ed1a695 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c @@ -765,15 +765,15 @@ static void hdmi_resources_cleanup(struct hdmi_device *hdev) regulator_bulk_free(res->regul_count, res->regul_bulk); /* kfree is NULL-safe */ kfree(res->regul_bulk); - if (!IS_ERR_OR_NULL(res->hdmiphy)) + if (!IS_ERR(res->hdmiphy)) clk_put(res->hdmiphy); - if (!IS_ERR_OR_NULL(res->sclk_hdmiphy)) + if (!IS_ERR(res->sclk_hdmiphy)) clk_put(res->sclk_hdmiphy); - if (!IS_ERR_OR_NULL(res->sclk_pixel)) + if (!IS_ERR(res->sclk_pixel)) clk_put(res->sclk_pixel); - if (!IS_ERR_OR_NULL(res->sclk_hdmi)) + if (!IS_ERR(res->sclk_hdmi)) clk_put(res->sclk_hdmi); - if (!IS_ERR_OR_NULL(res->hdmi)) + if (!IS_ERR(res->hdmi)) clk_put(res->hdmi); memset(res, 0, sizeof(*res)); } @@ -793,8 +793,14 @@ static int hdmi_resources_init(struct hdmi_device *hdev) dev_dbg(dev, "HDMI resource init\n"); memset(res, 0, sizeof(*res)); - /* get clocks, power */ + res->hdmi = ERR_PTR(-EINVAL); + res->sclk_hdmi = ERR_PTR(-EINVAL); + res->sclk_pixel = ERR_PTR(-EINVAL); + res->sclk_hdmiphy = ERR_PTR(-EINVAL); + res->hdmiphy = ERR_PTR(-EINVAL); + + /* get clocks, power */ res->hdmi = clk_get(dev, "hdmi"); if (IS_ERR(res->hdmi)) { dev_err(dev, "failed to get clock 'hdmi'\n");