From patchwork Fri Nov 23 11:50:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1795131 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0EA393FC64 for ; Fri, 23 Nov 2012 11:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754656Ab2KWL5K (ORCPT ); Fri, 23 Nov 2012 06:57:10 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:64565 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105Ab2KWL5I (ORCPT ); Fri, 23 Nov 2012 06:57:08 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so3502852pad.19 for ; Fri, 23 Nov 2012 03:57:08 -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=MSCngHN6MB5dLAUY/9XAKnKbAmQAiZN9ExuqpZSVk70=; b=diES6UquXuTZx/YnD+nB9QM3U/DUK90yRhNCh422xMNmy7U5B9QwY1+iPkJ/q79sSS hP+rP6qGy9mPAy9YRF67f/fZidEdV7WAjdqyKbxxacnulCWStz1yMMeIiUsa2GiNlJYK gLN77my3KhtlLUGOQOmW9ws3/nUJS1CZ5KyWXfYRzxa5A5lggh2AVRBJJ3hLfJXzAHv0 yQa3Q+B5JrcGf6flSePan8/dUT1HxIlmQIj+5dAns5lIUlSJs2IrtdsNWAtte9EsiJ/J MjslSj3DfdtlaRF8TtoEQu0NAjZhWWKWWwI9wMj4OEFwd1h3YgTjbQo8d+nniWAp5YMY vYtQ== Received: by 10.66.84.40 with SMTP id v8mr9792657pay.47.1353671828590; Fri, 23 Nov 2012 03:57:08 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id zv10sm3718784pbc.76.2012.11.23.03.57.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:57:08 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 3/6] [media] s5p-fimc: Use devm_clk_get in fimc-lite.c Date: Fri, 23 Nov 2012 17:20:40 +0530 Message-Id: <1353671443-2978-4-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: ALoCoQmOgG7k/kFhZUaD9mDrgCI0akNHJMHe6eyLlX7fdW+3vmWVWAzUs8hnQnHpNm+40r87ug8G 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 and makes error handling and cleanup a bit simpler. Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-fimc/fimc-lite.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c index 70bcf39..02d0ff9 100644 --- a/drivers/media/platform/s5p-fimc/fimc-lite.c +++ b/drivers/media/platform/s5p-fimc/fimc-lite.c @@ -1382,23 +1382,17 @@ static void fimc_lite_clk_put(struct fimc_lite *fimc) return; clk_unprepare(fimc->clock); - clk_put(fimc->clock); - fimc->clock = NULL; } static int fimc_lite_clk_get(struct fimc_lite *fimc) { int ret; - fimc->clock = clk_get(&fimc->pdev->dev, FLITE_CLK_NAME); + fimc->clock = devm_clk_get(&fimc->pdev->dev, FLITE_CLK_NAME); if (IS_ERR(fimc->clock)) return PTR_ERR(fimc->clock); ret = clk_prepare(fimc->clock); - if (ret < 0) { - clk_put(fimc->clock); - fimc->clock = NULL; - } return ret; }