From patchwork Fri Aug 10 11:53:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1305221 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 9F576DF215 for ; Fri, 10 Aug 2012 11:55:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753583Ab2HJLzW (ORCPT ); Fri, 10 Aug 2012 07:55:22 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:38428 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255Ab2HJLzW (ORCPT ); Fri, 10 Aug 2012 07:55:22 -0400 Received: by pbbrr13 with SMTP id rr13so2611852pbb.19 for ; Fri, 10 Aug 2012 04:55:21 -0700 (PDT) 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:x-gm-message-state; bh=JX4Qem2nsXWuaYSVrJXivxPlH/ErM3QR1GL5+cjGOwE=; b=UMnC99wT9BbEalwkxMwSsrYxvqB/cfSbx0e5EqqJu6XA+iSO2efpKG9VCbxJ81AGM3 MY+Dt9ZrvW0/aD4K8LyLnwX4kNv8o6o5SFMoyu5vM/uOmkXGyW1a5fi69X5jT4T397Lw 9WsGHZESaQFT2LiEZQO43ts5MI1JEQSSxEhh4hSd6Zao68ha7I8Tb/uitU+lL+g8mJzh bvcQI3zTaQAYMSA3JXN9AZ5LwM6OX4k14+KHbSaXFF4JNwB/9p2apiUr4QQMmeTGZPIQ Xfut8kppOXvNNFV41yaku8Ni6YC+UwONUWDzriZpkSAF0e+Wxe/st/kL5uIRef93kG4J ZlJg== Received: by 10.66.76.231 with SMTP id n7mr5673299paw.68.1344599721471; Fri, 10 Aug 2012 04:55:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id tq4sm3228260pbc.11.2012.08.10.04.55.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 04:55:21 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, mchehab@infradead.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/2] [media] s5p-tv: Use devm_regulator_get() in sdo_drv.c file Date: Fri, 10 Aug 2012 17:23:45 +0530 Message-Id: <1344599626-21881-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnYyfjw/4NpKMeCUu2FjMo8OeFeDDvN16gIU+2HWEhAIKp/DQ0APEQ4jXqnPvDamortJp19 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org devm_regulator_get() is a device managed function and makes the exit code a bit simpler and cleaner. Signed-off-by: Sachin Kamat --- drivers/media/video/s5p-tv/sdo_drv.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/s5p-tv/sdo_drv.c b/drivers/media/video/s5p-tv/sdo_drv.c index f6bca2c..ad68bbe 100644 --- a/drivers/media/video/s5p-tv/sdo_drv.c +++ b/drivers/media/video/s5p-tv/sdo_drv.c @@ -374,15 +374,15 @@ static int __devinit sdo_probe(struct platform_device *pdev) dev_info(dev, "fout_vpll.rate = %lu\n", clk_get_rate(sclk_vpll)); /* acquire regulator */ - sdev->vdac = regulator_get(dev, "vdd33a_dac"); + sdev->vdac = devm_regulator_get(dev, "vdd33a_dac"); if (IS_ERR_OR_NULL(sdev->vdac)) { dev_err(dev, "failed to get regulator 'vdac'\n"); goto fail_fout_vpll; } - sdev->vdet = regulator_get(dev, "vdet"); + sdev->vdet = devm_regulator_get(dev, "vdet"); if (IS_ERR_OR_NULL(sdev->vdet)) { dev_err(dev, "failed to get regulator 'vdet'\n"); - goto fail_vdac; + goto fail_fout_vpll; } /* enable gate for dac clock, because mixer uses it */ @@ -406,8 +406,6 @@ static int __devinit sdo_probe(struct platform_device *pdev) dev_info(dev, "probe succeeded\n"); return 0; -fail_vdac: - regulator_put(sdev->vdac); fail_fout_vpll: clk_put(sdev->fout_vpll); fail_dacphy: @@ -428,8 +426,6 @@ static int __devexit sdo_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); clk_disable(sdev->dac); - regulator_put(sdev->vdet); - regulator_put(sdev->vdac); clk_put(sdev->fout_vpll); clk_put(sdev->dacphy); clk_put(sdev->dac);