[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTinQYV8FJsy+5_sU8sTBhYPC7AQPow@mail.gmail.com>
Date: Wed, 22 Jun 2011 11:40:46 +0900
From: MyungJoo Ham <myungjoo.ham@...sung.com>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc: linux-kernel@...r.kernel.org, linux-samsung-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Kukjin Kim <kgene.kim@...sung.com>,
Russell King <linux@....linux.org.uk>,
Ben Dooks <ben-linux@...ff.org>,
Kyungmin Park <kyungmin.park@...sung.com>, dg77.kim@...sung.com
Subject: Re: [PATCH v2 1/5] Samsung SoC ADC: use regulator (VDD for ADC).
On Tue, Jun 21, 2011 at 7:43 PM, Mark Brown
<broonie@...nsource.wolfsonmicro.com> wrote:
> On Tue, Jun 21, 2011 at 10:58:43AM +0900, MyungJoo Ham wrote:
>
>> + ret = regulator_enable(adc->vdd);
>> + if (!ret)
>> + goto err_ioremap;
>> +
>
> This test looks the wrong way round? regulator_enable() should return 0
> on success but this will treat that as an error.
Whoops.. thanks for pointing that out!
>
>> static int s3c_adc_resume(struct platform_device *pdev)
>> {
>> struct adc_device *adc = platform_get_drvdata(pdev);
>> + int ret;
>>
>> + ret = regulator_enable(adc->vdd);
>> clk_enable(adc->clk);
>> enable_irq(adc->irq);
>>
>> writel(adc->prescale | S3C2410_ADCCON_PRSCEN,
>> adc->regs + S3C2410_ADCCON);
>>
>> - return 0;
>> + return ret;
>
> Seems better to return as soon as we notice the error, no point in
> starting anything else up if we don't have power.
>
Ok. I see.
--
MyungJoo Ham (함명주), Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists