From patchwork Fri May 17 04:31:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 17008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC3CA2391B for ; Fri, 17 May 2013 04:45:18 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id q16sf3160315vbe.7 for ; Thu, 16 May 2013 21:44:38 -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 :in-reply-to:references: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=A86mbrMXFfylUsdL+8gnQPrdC1Zc6aVwpocf7KMsPM4=; b=nzOLooP1ibZDERijd7Dw2nD/0wCiKavrudOLGaWhY1kafd0P+8gX0LbxfCsX4k/YaI X0dhnqtBzQN9WKRn1BuwjSUj6lEj2OX+l9p/JxmvXWy8PhgVfL31q76P2dmdG8HdWLtn coulFReP+TUaH6DDVWqM19VvFPUvgnJ3ulAwFYZwlVwN1kkAvZnZ1aVbVW/qd2wwMlVi vt2CUxrgVYjOsZH8ZYSyc8DgiFGJQBOAF5tCP1RlIXLwEB0kbfq7mCFVuSNO1tjymQwd 4uMAcgMvBq7xiYM/767AN11G36b82zZH6uBaFRAd2WWHCCUjlTyP+8Yn05Mbf5mQelrO mL8Q== X-Received: by 10.224.59.205 with SMTP id m13mr27319680qah.7.1368765877770; Thu, 16 May 2013 21:44:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.109.5 with SMTP id ho5ls1602664qeb.29.gmail; Thu, 16 May 2013 21:44:37 -0700 (PDT) X-Received: by 10.220.96.76 with SMTP id g12mr28847458vcn.53.1368765877641; Thu, 16 May 2013 21:44:37 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id sa4si5132677vdc.114.2013.05.16.21.44.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 21:44:37 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22a; Received: by mail-ve0-f170.google.com with SMTP id 15so1844652vea.29 for ; Thu, 16 May 2013 21:44:37 -0700 (PDT) X-Received: by 10.52.69.200 with SMTP id g8mr7376335vdu.4.1368765877391; Thu, 16 May 2013 21:44:37 -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.220.126.138 with SMTP id c10csp91267vcs; Thu, 16 May 2013 21:44:36 -0700 (PDT) X-Received: by 10.66.166.107 with SMTP id zf11mr47302485pab.166.1368765876115; Thu, 16 May 2013 21:44:36 -0700 (PDT) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx.google.com with ESMTPS id lm2si6860853pab.296.2013.05.16.21.44.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 21:44:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.172 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.192.172; Received: by mail-pd0-f172.google.com with SMTP id 6so2988642pdd.3 for ; Thu, 16 May 2013 21:44:35 -0700 (PDT) X-Received: by 10.66.240.70 with SMTP id vy6mr47623403pac.70.1368765875614; Thu, 16 May 2013 21:44:35 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id aa8sm10477520pad.14.2013.05.16.21.44.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 May 2013 21:44:35 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, sylvester.nawrocki@gmail.com, s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v4 2/2] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in mixer_drv.c Date: Fri, 17 May 2013 10:01:02 +0530 Message-Id: <1368765062-6194-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1368765062-6194-1-git-send-email-sachin.kamat@linaro.org> References: <1368765062-6194-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkpb4RpOXvNlOxySo3czQKTWNpOaAxcJg1AkX3q416pAPKH40ZtdXebDBKHSrG8pkm5aNso X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22a 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 --- drivers/media/platform/s5p-tv/mixer_drv.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c b/drivers/media/platform/s5p-tv/mixer_drv.c index 5733033..7aeefdb 100644 --- a/drivers/media/platform/s5p-tv/mixer_drv.c +++ b/drivers/media/platform/s5p-tv/mixer_drv.c @@ -211,6 +211,15 @@ fail: return ret; } +static void mxr_resource_clear_clocks(struct mxr_resources *res) +{ + res->mixer = ERR_PTR(-EINVAL); + res->vp = ERR_PTR(-EINVAL); + res->sclk_mixer = ERR_PTR(-EINVAL); + res->sclk_hdmi = ERR_PTR(-EINVAL); + res->sclk_dac = ERR_PTR(-EINVAL); +} + static void mxr_release_plat_resources(struct mxr_device *mdev) { free_irq(mdev->res.irq, mdev); @@ -222,15 +231,15 @@ static void mxr_release_clocks(struct mxr_device *mdev) { struct mxr_resources *res = &mdev->res; - if (!IS_ERR_OR_NULL(res->sclk_dac)) + if (!IS_ERR(res->sclk_dac)) clk_put(res->sclk_dac); - 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->sclk_mixer)) + if (!IS_ERR(res->sclk_mixer)) clk_put(res->sclk_mixer); - if (!IS_ERR_OR_NULL(res->vp)) + if (!IS_ERR(res->vp)) clk_put(res->vp); - if (!IS_ERR_OR_NULL(res->mixer)) + if (!IS_ERR(res->mixer)) clk_put(res->mixer); } @@ -239,7 +248,9 @@ static int mxr_acquire_clocks(struct mxr_device *mdev) struct mxr_resources *res = &mdev->res; struct device *dev = mdev->dev; - res->mixer = clk_get(dev, "mixer"); + mxr_resource_clear_clocks(res); + + res->mixer = clk_get(dev, "mixer"); if (IS_ERR(res->mixer)) { mxr_err(mdev, "failed to get clock 'mixer'\n"); goto fail; @@ -299,6 +310,7 @@ static void mxr_release_resources(struct mxr_device *mdev) mxr_release_clocks(mdev); mxr_release_plat_resources(mdev); memset(&mdev->res, 0, sizeof(mdev->res)); + mxr_resource_clear_clocks(&mdev->res); } static void mxr_release_layers(struct mxr_device *mdev)