From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eduardo Valentin Subject: Re: [PATCH 4/6] thermal: Support for TMU regulator defined at device tree Date: Fri, 19 Apr 2013 13:23:21 -0400 Message-ID: <51717D89.3090303@ti.com> References: <1366389493-8239-1-git-send-email-l.majewski@samsung.com> <1366389493-8239-5-git-send-email-l.majewski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from bear.ext.ti.com ([192.94.94.41]:38994 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751738Ab3DSRXn (ORCPT ); Fri, 19 Apr 2013 13:23:43 -0400 In-Reply-To: <1366389493-8239-5-git-send-email-l.majewski@samsung.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Lukasz Majewski Cc: Kukjin Kim , Mike Turquette , Zhang Rui , devicetree-discuss@lists.ozlabs.org, linux-samsung-soc@vger.kernel.org, Linux PM list , Amit Daniel Kachhap , Kyungmin Park , eduardo.valentin@ti.com On 19-04-2013 12:38, Lukasz Majewski wrote: > TMU probe function now checks for a device tree defined regulator. > For compatibility reasons it is allowed to probe driver even without > this regulator defined. > > Signed-off-by: Lukasz Majewski > Signed-off-by: Kyungmin Park > --- > drivers/thermal/exynos_thermal.c | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c > index ba6094c..e922fa4 100644 > --- a/drivers/thermal/exynos_thermal.c > +++ b/drivers/thermal/exynos_thermal.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > > #include > > @@ -119,6 +120,8 @@ > > #define EXYNOS_ZONE_COUNT 3 > > +#define EXYNOS_TMU_REGULATOR "vdd_ts" > + > struct exynos_tmu_data { > struct exynos_tmu_platform_data *pdata; > struct resource *mem; > @@ -944,6 +947,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) > { > struct exynos_tmu_data *data; > struct exynos_tmu_platform_data *pdata = pdev->dev.platform_data; > + struct regulator *reg; > int ret, i; > > if (!pdata) > @@ -953,6 +957,21 @@ static int exynos_tmu_probe(struct platform_device *pdev) > dev_err(&pdev->dev, "No platform init data supplied.\n"); > return -ENODEV; > } > + > + reg = regulator_get(&pdev->dev, EXYNOS_TMU_REGULATOR); > + if (!IS_ERR(reg)) { > + ret = regulator_enable(reg); > + if (ret) { > + dev_err(&pdev->dev, "Regulator %s not enabled.\n", > + EXYNOS_TMU_REGULATOR); > + return ret; > + } > + } else { > + dev_info(&pdev->dev, > + "Regulator %s not defined at device tree.\n", > + EXYNOS_TMU_REGULATOR); Maybe a dev_warn would fit better? > + } > + > data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data), > GFP_KERNEL); > if (!data) { >