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: 1795111 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 CCC71DF254 for ; Fri, 23 Nov 2012 11:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754804Ab2KWL5E (ORCPT ); Fri, 23 Nov 2012 06:57:04 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:53524 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754105Ab2KWL5D (ORCPT ); Fri, 23 Nov 2012 06:57:03 -0500 Received: by mail-pb0-f46.google.com with SMTP id wy7so6487315pbc.19 for ; Fri, 23 Nov 2012 03:57:03 -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=D1/rHNCBra4TwapjK0TpnTwa66rkS/cmxDG9tiRq3IQ=; b=n4UZgRdENy7Q2XJSyEuykqZbNzAtJSMrh9lgrJLpsOPAC1cprKvFTONgInjXaM7EtJ vlsfiw3MuHvMVGdASn4aoQUmEV/8wXMk2LWwtf5vERb0P2kVBP+XJEEwfWbqh5SKv3tr uZzhOCAUniT90Cr3XiyZYCq6iYxgyqup5cExzqDy1iQ4PIovLpUZgQjK90K8YDHSEBBW 9Az2ps5WR1VTtUww6zoC2+NRbZPcrRDuE8PjycAH54htF+EKDKHWT/3F7WO2Xjk+Ey2m eDn/tldE45Lwsh/9U1JQg/Yv9Hhfmx5k6csd412Js/uj8ze5xVudc3eNNyJPCzXjpNF1 L2nA== 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: ALoCoQnIvF2ViiXVttKERMaetJaAzy07DaFJ27ACk3bLehIYKHDuC3sAePynRrYBvpXp9c5rdOIc 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/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; } }