diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-09-28 08:50:18 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-28 18:29:53 -0400 |
commit | 7e2bb82ee0d74b621bab452888cc3e7e8a013d0b (patch) | |
tree | 37617053f5e724e8f53ac67e2b2f06ac4516bcc0 /drivers/mfd | |
parent | 99ea2626a75e13ce926af69d96e9ae5bfb62b7ba (diff) |
mfd: Remove obsolete mc13783 private data
The regulator driver was converted to get the needed data directly from
platform_data by
a10099b (regulator/mc13783: various cleanups)
so regulators and num_regulators can go away. Then apart from the flag
indicating that the adc does a conversion, flags is only a copy of the
flags member of platform_data. This flag isn't needed to be returned by
mc13783_get_flags, so mc13783_get_flags now gets the flags from
platform_data, too and the driver private member is renamed for clearity.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/mc13783-core.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/mfd/mc13783-core.c b/drivers/mfd/mc13783-core.c index 6df34989c1f6..2506e6888507 100644 --- a/drivers/mfd/mc13783-core.c +++ b/drivers/mfd/mc13783-core.c | |||
@@ -22,14 +22,10 @@ struct mc13783 { | |||
22 | struct spi_device *spidev; | 22 | struct spi_device *spidev; |
23 | struct mutex lock; | 23 | struct mutex lock; |
24 | int irq; | 24 | int irq; |
25 | int flags; | 25 | int adcflags; |
26 | 26 | ||
27 | irq_handler_t irqhandler[MC13783_NUM_IRQ]; | 27 | irq_handler_t irqhandler[MC13783_NUM_IRQ]; |
28 | void *irqdata[MC13783_NUM_IRQ]; | 28 | void *irqdata[MC13783_NUM_IRQ]; |
29 | |||
30 | /* XXX these should go as platformdata to the regulator subdevice */ | ||
31 | struct mc13783_regulator_init_data *regulators; | ||
32 | int num_regulators; | ||
33 | }; | 29 | }; |
34 | 30 | ||
35 | #define MC13783_REG_REVISION 7 | 31 | #define MC13783_REG_REVISION 7 |
@@ -250,7 +246,10 @@ EXPORT_SYMBOL(mc13783_reg_rmw); | |||
250 | 246 | ||
251 | int mc13783_get_flags(struct mc13783 *mc13783) | 247 | int mc13783_get_flags(struct mc13783 *mc13783) |
252 | { | 248 | { |
253 | return mc13783->flags; | 249 | struct mc13783_platform_data *pdata = |
250 | dev_get_platdata(&mc13783->spidev->dev); | ||
251 | |||
252 | return pdata->flags; | ||
254 | } | 253 | } |
255 | EXPORT_SYMBOL(mc13783_get_flags); | 254 | EXPORT_SYMBOL(mc13783_get_flags); |
256 | 255 | ||
@@ -493,7 +492,7 @@ static irqreturn_t mc13783_handler_adcdone(int irq, void *data) | |||
493 | return IRQ_HANDLED; | 492 | return IRQ_HANDLED; |
494 | } | 493 | } |
495 | 494 | ||
496 | #define MC13783_ADC_WORKING (1 << 16) | 495 | #define MC13783_ADC_WORKING (1 << 0) |
497 | 496 | ||
498 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | 497 | int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, |
499 | unsigned int channel, unsigned int *sample) | 498 | unsigned int channel, unsigned int *sample) |
@@ -509,12 +508,12 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
509 | 508 | ||
510 | mc13783_lock(mc13783); | 509 | mc13783_lock(mc13783); |
511 | 510 | ||
512 | if (mc13783->flags & MC13783_ADC_WORKING) { | 511 | if (mc13783->adcflags & MC13783_ADC_WORKING) { |
513 | ret = -EBUSY; | 512 | ret = -EBUSY; |
514 | goto out; | 513 | goto out; |
515 | } | 514 | } |
516 | 515 | ||
517 | mc13783->flags |= MC13783_ADC_WORKING; | 516 | mc13783->adcflags |= MC13783_ADC_WORKING; |
518 | 517 | ||
519 | mc13783_reg_read(mc13783, MC13783_ADC0, &old_adc0); | 518 | mc13783_reg_read(mc13783, MC13783_ADC0, &old_adc0); |
520 | 519 | ||
@@ -578,7 +577,7 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode, | |||
578 | /* restore TSMOD */ | 577 | /* restore TSMOD */ |
579 | mc13783_reg_write(mc13783, MC13783_REG_ADC_0, old_adc0); | 578 | mc13783_reg_write(mc13783, MC13783_REG_ADC_0, old_adc0); |
580 | 579 | ||
581 | mc13783->flags &= ~MC13783_ADC_WORKING; | 580 | mc13783->adcflags &= ~MC13783_ADC_WORKING; |
582 | out: | 581 | out: |
583 | mc13783_unlock(mc13783); | 582 | mc13783_unlock(mc13783); |
584 | 583 | ||
@@ -675,14 +674,6 @@ err_revision: | |||
675 | return ret; | 674 | return ret; |
676 | } | 675 | } |
677 | 676 | ||
678 | /* This should go away (BEGIN) */ | ||
679 | if (pdata) { | ||
680 | mc13783->flags = pdata->flags; | ||
681 | mc13783->regulators = pdata->regulators; | ||
682 | mc13783->num_regulators = pdata->num_regulators; | ||
683 | } | ||
684 | /* This should go away (END) */ | ||
685 | |||
686 | mc13783_unlock(mc13783); | 677 | mc13783_unlock(mc13783); |
687 | 678 | ||
688 | if (pdata->flags & MC13783_USE_ADC) | 679 | if (pdata->flags & MC13783_USE_ADC) |