Message ID | 1358254566-12419-26-git-send-email-lee.jones@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Lee, On Tue, Jan 15, 2013 at 12:56:05PM +0000, Lee Jones wrote: > @@ -598,8 +601,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) > > static int ab8500_gpadc_runtime_idle(struct device *dev) > { > - struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); > - Unrelated change, please remove that part. Cheers, Samuel.
On Mon, 28 Jan 2013, Samuel Ortiz wrote: > Hi Lee, > > On Tue, Jan 15, 2013 at 12:56:05PM +0000, Lee Jones wrote: > > @@ -598,8 +601,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) > > > > static int ab8500_gpadc_runtime_idle(struct device *dev) > > { > > - struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); > > - > Unrelated change, please remove that part. I'll fixup.
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 1fd8f78..a7a6c77 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -86,6 +86,8 @@ /* Time in ms before disabling regulator */ #define GPADC_AUDOSUSPEND_DELAY 1 +#define CONVERSION_TIME 500 /* ms */ + enum cal_channels { ADC_INPUT_VMAIN = 0, ADC_INPUT_BTEMP, @@ -372,7 +374,8 @@ int ab8500_gpadc_read_raw(struct ab8500_gpadc *gpadc, u8 channel) goto out; } /* wait for completion of conversion */ - if (!wait_for_completion_timeout(&gpadc->ab8500_gpadc_complete, 2*HZ)) { + if (!wait_for_completion_timeout(&gpadc->ab8500_gpadc_complete, + msecs_to_jiffies(CONVERSION_TIME))) { dev_err(gpadc->dev, "timeout: didn't receive GPADC conversion interrupt\n"); ret = -EINVAL; @@ -598,8 +601,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) static int ab8500_gpadc_runtime_idle(struct device *dev) { - struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); - pm_runtime_suspend(dev); return 0; }