diff options
Diffstat (limited to 'drivers/input/touchscreen/mc13783_ts.c')
-rw-r--r-- | drivers/input/touchscreen/mc13783_ts.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index d6f099c47f84..0e24304fddc3 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -124,10 +124,17 @@ static void mc13783_ts_work(struct work_struct *work) container_of(work, struct mc13783_ts_priv, work.work); unsigned int mode = MC13XXX_ADC_MODE_TS; unsigned int channel = 12; + u8 ato = 0; + bool atox = 0; + + if (priv->touch) { + ato = priv->touch->ato; + atox = priv->touch->atox; + } if (mc13xxx_adc_do_conversion(priv->mc13xxx, mode, channel, - priv->touch->ato, priv->touch->atox, + ato, atox, priv->sample) == 0) mc13783_ts_report_sample(priv); } @@ -183,11 +190,8 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); priv->idev = idev; priv->touch = dev_get_platdata(&pdev->dev); - if (!priv->touch) { + if (!priv->touch) dev_err(&pdev->dev, "missing platform data\n"); - ret = -ENODEV; - goto err_free_mem; - } /* * We need separate workqueue because mc13783_adc_do_conversion |