From patchwork Thu May 2 05:03:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 16566 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gh0-f198.google.com (mail-gh0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E60DA23942 for ; Thu, 2 May 2013 05:16:33 +0000 (UTC) Received: by mail-gh0-f198.google.com with SMTP id r13sf342426ghr.5 for ; Wed, 01 May 2013 22:16:27 -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=NZw1i0iYZjIcyTfbpQTqTYsAw6P3u8h4vFQq2tHo+Pk=; b=HO/EOxEWXb3ks72S7y6ZAd7TU2Ri3xQ7PgF93SrLp4NyA+Hd+EocdJUX2iIAzLfXBx cu3HjGdTuaKBCNlwFD9LF1XXSrmM4x7jpzNiC1FAXZcX/NWsUF37Ur7uhp436zNElPRQ +ss2lv/cmJ5PDcYQXJdDTuXjgqVPddTFmf++Y+LoF2a2UPX1cC9XZvrq48KfZ5T20Fok cDi3Tq+iMAO95Jti4PXbGovlkQNwEp+e6lt3Di9kaf8l6Ozi0FB5Q8k8DnI8w8ss5R0/ kwxiwGafU1+wSOXfX9Y6LZPwAwUzERj+kW+WZpFos6j75Ws/BfGAoxOPns2RCAxcnayf seyA== X-Received: by 10.236.117.178 with SMTP id j38mr4093989yhh.45.1367471787316; Wed, 01 May 2013 22:16:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.78 with SMTP id 14ls1135964qec.10.gmail; Wed, 01 May 2013 22:16:27 -0700 (PDT) X-Received: by 10.52.25.40 with SMTP id z8mr1424764vdf.7.1367471787145; Wed, 01 May 2013 22:16:27 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id b7si2302632vco.76.2013.05.01.22.16.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id ha12so167744vcb.8 for ; Wed, 01 May 2013 22:16:27 -0700 (PDT) X-Received: by 10.52.228.71 with SMTP id sg7mr1379348vdc.51.1367471787023; Wed, 01 May 2013 22:16:27 -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 nf2csp184793veb; Wed, 1 May 2013 22:16:26 -0700 (PDT) X-Received: by 10.66.144.233 with SMTP id sp9mr6132160pab.178.1367471786000; Wed, 01 May 2013 22:16:26 -0700 (PDT) Received: from mail-da0-x235.google.com (mail-da0-x235.google.com [2607:f8b0:400e:c00::235]) by mx.google.com with ESMTPS id wt9si4217869pab.269.2013.05.01.22.16.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:25 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c00::235 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=2607:f8b0:400e:c00::235; Received: by mail-da0-f53.google.com with SMTP id o9so133559dan.12 for ; Wed, 01 May 2013 22:16:25 -0700 (PDT) X-Received: by 10.66.100.231 with SMTP id fb7mr7887663pab.162.1367471785604; Wed, 01 May 2013 22:16:25 -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.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 May 2013 22:16:24 -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 2/2] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in mixer_drv.c Date: Thu, 2 May 2013 10:33:29 +0530 Message-Id: <1367471009-7103-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1367471009-7103-1-git-send-email-sachin.kamat@linaro.org> References: <1367471009-7103-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkvEzwff1ELh0YPGH8aI/FSudLzE0xJGibu8e1lZ16gFz2MAaDXVj4natlB7wjTCBDW9Ff2 X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 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/mixer_drv.c | 19 +++++++++++++------ 1 file changed, 13 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..506a5aa 100644 --- a/drivers/media/platform/s5p-tv/mixer_drv.c +++ b/drivers/media/platform/s5p-tv/mixer_drv.c @@ -222,15 +222,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 +239,14 @@ 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"); + + 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); + + res->mixer = clk_get(dev, "mixer"); if (IS_ERR(res->mixer)) { mxr_err(mdev, "failed to get clock 'mixer'\n"); goto fail;