lkml.org 
[lkml]   [2011]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/5] Samsung SoC ADC: use regulator (VDD for ADC).
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.

> 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.


\
 
 \ /
  Last update: 2011-06-21 12:47    [W:0.378 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site