Skip to content

Commit 7e2bb82

Browse files
Uwe Kleine-KönigSamuel Ortiz
authored andcommitted
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>
1 parent 99ea262 commit 7e2bb82

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

‎drivers/mfd/mc13783-core.c‎

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@ struct mc13783 {
2222
struct spi_device *spidev;
2323
struct mutex lock;
2424
int irq;
25-
int flags;
25+
int adcflags;
2626

2727
irq_handler_t irqhandler[MC13783_NUM_IRQ];
2828
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;
3329
};
3430

3531
#define MC13783_REG_REVISION 7
@@ -250,7 +246,10 @@ EXPORT_SYMBOL(mc13783_reg_rmw);
250246

251247
int mc13783_get_flags(struct mc13783 *mc13783)
252248
{
253-
return mc13783->flags;
249+
struct mc13783_platform_data *pdata =
250+
dev_get_platdata(&mc13783->spidev->dev);
251+
252+
return pdata->flags;
254253
}
255254
EXPORT_SYMBOL(mc13783_get_flags);
256255

@@ -493,7 +492,7 @@ static irqreturn_t mc13783_handler_adcdone(int irq, void *data)
493492
return IRQ_HANDLED;
494493
}
495494

496-
#define MC13783_ADC_WORKING (1 << 16)
495+
#define MC13783_ADC_WORKING (1 << 0)
497496

498497
int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
499498
unsigned int channel, unsigned int *sample)
@@ -509,12 +508,12 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
509508

510509
mc13783_lock(mc13783);
511510

512-
if (mc13783->flags & MC13783_ADC_WORKING) {
511+
if (mc13783->adcflags & MC13783_ADC_WORKING) {
513512
ret = -EBUSY;
514513
goto out;
515514
}
516515

517-
mc13783->flags |= MC13783_ADC_WORKING;
516+
mc13783->adcflags |= MC13783_ADC_WORKING;
518517

519518
mc13783_reg_read(mc13783, MC13783_ADC0, &old_adc0);
520519

@@ -578,7 +577,7 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
578577
/* restore TSMOD */
579578
mc13783_reg_write(mc13783, MC13783_REG_ADC_0, old_adc0);
580579

581-
mc13783->flags &= ~MC13783_ADC_WORKING;
580+
mc13783->adcflags &= ~MC13783_ADC_WORKING;
582581
out:
583582
mc13783_unlock(mc13783);
584583

@@ -675,14 +674,6 @@ static int mc13783_probe(struct spi_device *spi)
675674
return ret;
676675
}
677676

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-
686677
mc13783_unlock(mc13783);
687678

688679
if (pdata->flags & MC13783_USE_ADC)

0 commit comments

Comments
 (0)