From patchwork Fri Nov 23 11:50:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13147 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BF64023DFE for ; Fri, 23 Nov 2012 11:57:15 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 819C9A19461 for ; Fri, 23 Nov 2012 11:57:15 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1705179ieb.11 for ; Fri, 23 Nov 2012 03:57:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=3vCXO3exwXOXkC9Kvepz4ifAN4a0kaPinGCExIQGJo0=; b=XGUskbAyyKWMh3QsjQaO+olqNSBc3Jq5ZguIxcPKzktzs5jDkYXjp7rwEWpzMfukPg arYN3SO1ie26ZBer0DESBR8+g1M93T8d2f5Y00rz528XYxspDaO+1MINZJZqW9dDnvNu LJkf+9rzS59VpaL59Kc06bga5pH+wJFPYrz7h1G8FVkz2ziFIffISJiWRftSJNa/rcxb eDPWoxC/kMveM3/Sbey2SFje0xJ9yF1szqcOB3qEMp9CKWtyqXHiHF8CPEVyJgl818Z2 vL0uMfJCK4UWZVHlPWL+KyeP0wrqzQMEqu11MJf4KzLKvrcihedT09aQR46B1vHKhHgo NygQ== Received: by 10.50.187.197 with SMTP id fu5mr3202043igc.70.1353671835298; Fri, 23 Nov 2012 03:57:15 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp341274igt; Fri, 23 Nov 2012 03:57:14 -0800 (PST) Received: by 10.68.234.36 with SMTP id ub4mr13723521pbc.68.1353671834768; Fri, 23 Nov 2012 03:57:14 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id j9si7748355pay.231.2012.11.23.03.57.14 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:57:14 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pa0-f52.google.com with SMTP id fb1so2597604pad.25 for ; Fri, 23 Nov 2012 03:57:14 -0800 (PST) Received: by 10.68.248.10 with SMTP id yi10mr13705488pbc.39.1353671834523; Fri, 23 Nov 2012 03:57:14 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id zv10sm3718784pbc.76.2012.11.23.03.57.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:57:14 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, Andrzej Pietrasiewicz Subject: [PATCH 5/6] [media] s5p-jpeg: Use devm_clk_get APIs. Date: Fri, 23 Nov 2012 17:20:42 +0530 Message-Id: <1353671443-2978-6-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353671443-2978-1-git-send-email-sachin.kamat@linaro.org> References: <1353671443-2978-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQm57J9Cy+jBw5/fBDESYAHEU3TScmqLbC/E5WyRH/j5WpNBzMV6lQG1zTH3ngu1QLr4fWIx devm_clk_get() is device managed function and makes error handling and exit code a bit simpler. Cc: Andrzej Pietrasiewicz Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 17983c4..fc63d27 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1346,7 +1346,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) } /* clocks */ - jpeg->clk = clk_get(&pdev->dev, "jpeg"); + jpeg->clk = devm_clk_get(&pdev->dev, "jpeg"); if (IS_ERR(jpeg->clk)) { dev_err(&pdev->dev, "cannot get clock\n"); ret = PTR_ERR(jpeg->clk); @@ -1461,7 +1461,6 @@ device_register_rollback: clk_get_rollback: clk_disable_unprepare(jpeg->clk); - clk_put(jpeg->clk); return ret; } @@ -1481,7 +1480,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev) v4l2_device_unregister(&jpeg->v4l2_dev); clk_disable_unprepare(jpeg->clk); - clk_put(jpeg->clk); return 0; }