From patchwork Tue Jan 8 06:58:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13905 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 1B3D023E1F for ; Tue, 8 Jan 2013 07:07:05 +0000 (UTC) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by fiordland.canonical.com (Postfix) with ESMTP id C8026A19C7C for ; Tue, 8 Jan 2013 07:07:04 +0000 (UTC) Received: by mail-vc0-f173.google.com with SMTP id f13so66679vcb.18 for ; Mon, 07 Jan 2013 23:07:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=6mt6Ow06Sli2iqA4PNXaHyINLPNXNTpER3Xy6+ygz/E=; b=FuY/AAwfWpuED0SzYqCTU8/V8wzvxvrhDSIqAhwq9JifcN7Z4fp5qR7zluCvaOVzVS f7jCvwugDFLNkuILDfXaL/gzIjavCvzpuGulRJAIjQ2vfw+BhTjWK/uEGzpEJsOUkIjn oWjA73D8LFOvrf60yGG0yVFohiC0k/oq3WkL6yK7ZWm8AHzzpT+TK9q41KBrh5R4cOSA Gy49ltHwHUVhjuetuFhqNhyp4B4dawL1r7inZ/AmgJsrv0wH8EghA1vx+Sy+25GygKjG rW+2+rOSS/XN/EiSzUui5RfoTy9WcSBdVDQse8OmxWq1fTlFCmU0jLd/cu2qU9taKDaT ZgxQ== X-Received: by 10.52.18.147 with SMTP id w19mr75103072vdd.94.1357628823175; Mon, 07 Jan 2013 23:07:03 -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.58.145.101 with SMTP id st5csp97135veb; Mon, 7 Jan 2013 23:07:02 -0800 (PST) X-Received: by 10.68.130.226 with SMTP id oh2mr152871706pbb.157.1357628822175; Mon, 07 Jan 2013 23:07:02 -0800 (PST) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx.google.com with ESMTPS id n6si62063290paw.138.2013.01.07.23.07.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 23:07:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.54 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.54; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.54 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-da0-f54.google.com with SMTP id n2so49486dad.27 for ; Mon, 07 Jan 2013 23:07:01 -0800 (PST) X-Received: by 10.68.135.99 with SMTP id pr3mr197252761pbb.151.1357628821805; Mon, 07 Jan 2013 23:07:01 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id y9sm4598492paw.1.2013.01.07.23.06.59 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Jan 2013 23:07:01 -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/1] [media] s5p-csis: Use devm_regulator_bulk_get API Date: Tue, 8 Jan 2013 12:28:51 +0530 Message-Id: <1357628331-18955-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnRa2qkWQPQKxDC0/7QKz6TWGsQuhSmSSCh2SoQPKSD+iZhqDjHAbWVsW5TM9zq4hs8AN38 devm_regulator_bulk_get is device managed and saves some cleanup and exit code. Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-fimc/mipi-csis.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index cde510f..7e36ad9 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -743,7 +743,7 @@ static int s5pcsis_probe(struct platform_device *pdev) for (i = 0; i < CSIS_NUM_SUPPLIES; i++) state->supplies[i].supply = csis_supply_name[i]; - ret = regulator_bulk_get(&pdev->dev, CSIS_NUM_SUPPLIES, + ret = devm_regulator_bulk_get(&pdev->dev, CSIS_NUM_SUPPLIES, state->supplies); if (ret) return ret; @@ -762,7 +762,7 @@ static int s5pcsis_probe(struct platform_device *pdev) 0, dev_name(&pdev->dev), state); if (ret) { dev_err(&pdev->dev, "Interrupt request failed\n"); - goto e_regput; + goto e_clkput; } v4l2_subdev_init(&state->sd, &s5pcsis_subdev_ops); @@ -793,8 +793,6 @@ static int s5pcsis_probe(struct platform_device *pdev) pm_runtime_enable(&pdev->dev); return 0; -e_regput: - regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies); e_clkput: clk_disable(state->clock[CSIS_CLK_MUX]); s5pcsis_clk_put(state); @@ -903,7 +901,6 @@ static int s5pcsis_remove(struct platform_device *pdev) clk_disable(state->clock[CSIS_CLK_MUX]); pm_runtime_set_suspended(&pdev->dev); s5pcsis_clk_put(state); - regulator_bulk_free(CSIS_NUM_SUPPLIES, state->supplies); media_entity_cleanup(&state->sd.entity);