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: 1795151 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C7FF3DF254 for ; Fri, 23 Nov 2012 11:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829Ab2KWL5Q (ORCPT ); Fri, 23 Nov 2012 06:57:16 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:63829 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105Ab2KWL5O (ORCPT ); Fri, 23 Nov 2012 06:57:14 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so2614834dak.19 for ; Fri, 23 Nov 2012 03:57:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=3vCXO3exwXOXkC9Kvepz4ifAN4a0kaPinGCExIQGJo0=; b=jt3AASZQ5VQMd4nitOv+pSaGhvEN64tnvKIbO/l+sNyd3ToP5qeUS4ttyEuuJESg/W IWoV1xQtbIAwNKj+U2L4gBJ55td5ekIFim1KgAfZU0Aj62mQBsgf9x11G1U+772iXUrC fG/4/jwpaEEZD30/IOfcSdkbsbWG+metd7jiz9wlgOk2sqvbyju5sByVNb+1uLT0C3AI bG7YuTIjxFT+YoVnwGEfq981bMMG3qb8eXZaL3UdVWPyB8DVZlqaKZXN9N/oXE6s5EtS IRXQohD2Cwbm31PDz5GJfgejjjKEWArJBqfx6xoUZobkot4N9L3FmBxHMkqB17BdOQAk E37Q== 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: ALoCoQnU/i4mS20TWg068vMKUB2Su9ZSqpyx5NVLIBRmD1aYbsUnOxyDXx8EElXnB7TuLylVBzmq Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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; }