From 4ea74ee2c43f28da2e562782dc16d1a8dded08df Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Thu, 12 Jul 2012 14:39:13 -0700 Subject: [PATCH] power: pm8xxx-ccadc: missing calibration at bootup There is a bug in the sequence between when the calibration work is scheduled and the global chip pointer is initialized. If work is scheduled before the chip pointer is initialized it refuses to calibrate. Initialize the chip pointer before scheduling calibration work. Change-Id: I333c97c005e8bc17a28fc0dac3f76e4f26fcc486 Signed-off-by: Abhijeet Dharmapurikar --- drivers/power/pm8xxx-ccadc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/pm8xxx-ccadc.c b/drivers/power/pm8xxx-ccadc.c index 861bac88cd3..e48257acbcb 100644 --- a/drivers/power/pm8xxx-ccadc.c +++ b/drivers/power/pm8xxx-ccadc.c @@ -685,13 +685,13 @@ static int __devinit pm8xxx_ccadc_probe(struct platform_device *pdev) goto free_chip; } - INIT_DELAYED_WORK(&chip->calib_ccadc_work, calibrate_ccadc_work); - schedule_delayed_work(&chip->calib_ccadc_work, 0); disable_irq_nosync(chip->eoc_irq); platform_set_drvdata(pdev, chip); the_chip = chip; + INIT_DELAYED_WORK(&chip->calib_ccadc_work, calibrate_ccadc_work); + schedule_delayed_work(&chip->calib_ccadc_work, 0); create_debugfs_entries(chip);