Re: [PATCH v2 1/5] Samsung SoC ADC: use regulator (VDD for ADC).

From: MyungJoo Ham
Date: Tue Jun 21 2011 - 22:48:58 EST


On Tue, Jun 21, 2011 at 7:43 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/