From patchwork Fri Nov 23 11:50:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13143 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 D762223DFE for ; Fri, 23 Nov 2012 11:57:04 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 88870A18815 for ; Fri, 23 Nov 2012 11:57:04 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3712258iag.11 for ; Fri, 23 Nov 2012 03:57:04 -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=D1/rHNCBra4TwapjK0TpnTwa66rkS/cmxDG9tiRq3IQ=; b=aBeFusonmzbmc97duSx7A6Sa+OPaJ+ls+XfBRbzGA2NViotDgOuI95iwGAHljKHNzh DkyVDh5rTAhgsQH32YVFeTd3DZ3yDKzj46trr+H57kpee8762yJ/SRhYKEEXGP7f0C2D s7cfKD4YPXnBfP8bqukNgiEYdVvdMT/FYmlijKMr+bwaSASKis2oCuA7IbILGmQHiJ+M o5O0XJ6HcvlN3biLJWkNACFSEkPt5oVqefrK2bpKnarsmdGuskUCMirvBynPLvLTb600 pgmkoYWt27qqy5wBcbgWXC+kfAjRVRCvNIvl3nkzdPZswZoVyFvMhc5O4sSqKZjQRKoA 01dA== Received: by 10.50.186.199 with SMTP id fm7mr3186469igc.62.1353671824283; Fri, 23 Nov 2012 03:57:04 -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 n20csp341252igt; Fri, 23 Nov 2012 03:57:03 -0800 (PST) Received: by 10.66.76.98 with SMTP id j2mr9698734paw.65.1353671823371; Fri, 23 Nov 2012 03:57:03 -0800 (PST) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id q7si7808859paw.40.2012.11.23.03.57.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:57:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.43 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-pb0-f43.google.com with SMTP id wz17so6101698pbc.2 for ; Fri, 23 Nov 2012 03:57:03 -0800 (PST) Received: by 10.66.78.67 with SMTP id z3mr9845063paw.33.1353671823123; Fri, 23 Nov 2012 03:57:03 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id zv10sm3718784pbc.76.2012.11.23.03.57.00 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:57:02 -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 1/6] [media] s5p-fimc: Use devm_clk_get in mipi-csis.c Date: Fri, 23 Nov 2012 17:20:38 +0530 Message-Id: <1353671443-2978-2-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: ALoCoQkyAy0Gt/IVD7ggRX4kUdO6NlGGIKBWS6XHd2zRvW3p5wIJbapfkdWIxzckMl3XNGwzlpiY 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/mipi-csis.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index 4c961b1..d624bfa 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -341,8 +341,6 @@ static void s5pcsis_clk_put(struct csis_state *state) if (IS_ERR_OR_NULL(state->clock[i])) continue; clk_unprepare(state->clock[i]); - clk_put(state->clock[i]); - state->clock[i] = NULL; } } @@ -352,13 +350,11 @@ static int s5pcsis_clk_get(struct csis_state *state) int i, ret; for (i = 0; i < NUM_CSIS_CLOCKS; i++) { - state->clock[i] = clk_get(dev, csi_clock_name[i]); + state->clock[i] = devm_clk_get(dev, csi_clock_name[i]); if (IS_ERR(state->clock[i])) goto err; ret = clk_prepare(state->clock[i]); if (ret < 0) { - clk_put(state->clock[i]); - state->clock[i] = NULL; goto err; } }