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: 10677 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 DC1A123E02 for ; Fri, 10 Aug 2012 11:55:23 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id A4287A1886D for ; Fri, 10 Aug 2012 11:55:23 +0000 (UTC) Received: by ggnf1 with SMTP id f1so1464977ggn.11 for ; Fri, 10 Aug 2012 04:55:23 -0700 (PDT) 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:x-gm-message-state; bh=JX4Qem2nsXWuaYSVrJXivxPlH/ErM3QR1GL5+cjGOwE=; b=adW46H8GF84VPFNaxeJu0N4pSerwU7WUNAdXxuu9+4YpiaGkyu5kNOsxy+UXkdAbeU dIKcqdFEKoxMrX7hMO6LcyDZBlO4Rr7Sqe5z9RMb7nNEwYGEICKzdXms+1D3B7zvUy/s b3aDwH0Pn0ORPL7oubJPE11vxA69xZf3C9GN683TTBbXiKC/p4lCBMBvTxcmCB+dWiu4 qa07MHZFT/Gc8yBzfPuEzAMY7JEbibRP/ozFCoKlIaDob3jYSxSANOsgQc7odVgzlz97 ViL83gGWFK2A70qBPFMO5MYWaVxYmP0Yh66c93NBVyZitaaVcA0pZOOkeVx54w/eWWB1 ItbA== Received: by 10.50.154.132 with SMTP id vo4mr1461984igb.31.1344599722798; Fri, 10 Aug 2012 04:55:22 -0700 (PDT) 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.184.200 with SMTP id ew8csp56431igc; Fri, 10 Aug 2012 04:55:22 -0700 (PDT) Received: by 10.236.110.209 with SMTP id u57mr2584481yhg.101.1344599722205; Fri, 10 Aug 2012 04:55:22 -0700 (PDT) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by mx.google.com with ESMTPS id e22si3829300yhh.2.2012.08.10.04.55.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Aug 2012 04:55:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.213.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by yhjj63 with SMTP id j63so1678961yhj.37 for ; Fri, 10 Aug 2012 04:55:21 -0700 (PDT) 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: ALoCoQk5La6ZYsmzi9bZYlFZTZfdeCW8JjigTk8Rv58ccjHRFVj6PZNc00Gb0d3Sz1zMLZIZeX5L 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);