lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Sep 2010 18:23:44 +0200
From:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
To:	linux-kernel@...r.kernel.org, Samuel Ortiz <sameo@...ux.intel.com>,
	Alessandro Zummo <a.zummo@...ertech.it>,
	rtc-linux@...glegroups.com
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Richard Purdie <rpurdie@...ux.intel.com>,
	Alberto Panizzo <maramaopercheseimorto@...il.com>,
	Valentin Longchamp <valentin.longchamp@...l.ch>
Subject: [PATCH 1/4] mfd/mc13783: remove obsolete 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@...gutronix.de>
---
 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 6df3498..2506e68 100644
--- a/drivers/mfd/mc13783-core.c
+++ b/drivers/mfd/mc13783-core.c
@@ -22,14 +22,10 @@ struct mc13783 {
 	struct spi_device *spidev;
 	struct mutex lock;
 	int irq;
-	int flags;
+	int adcflags;
 
 	irq_handler_t irqhandler[MC13783_NUM_IRQ];
 	void *irqdata[MC13783_NUM_IRQ];
-
-	/* XXX these should go as platformdata to the regulator subdevice */
-	struct mc13783_regulator_init_data *regulators;
-	int num_regulators;
 };
 
 #define MC13783_REG_REVISION			 7
@@ -250,7 +246,10 @@ EXPORT_SYMBOL(mc13783_reg_rmw);
 
 int mc13783_get_flags(struct mc13783 *mc13783)
 {
-	return mc13783->flags;
+	struct mc13783_platform_data *pdata =
+		dev_get_platdata(&mc13783->spidev->dev);
+
+	return pdata->flags;
 }
 EXPORT_SYMBOL(mc13783_get_flags);
 
@@ -493,7 +492,7 @@ static irqreturn_t mc13783_handler_adcdone(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-#define MC13783_ADC_WORKING (1 << 16)
+#define MC13783_ADC_WORKING (1 << 0)
 
 int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
 		unsigned int channel, unsigned int *sample)
@@ -509,12 +508,12 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
 
 	mc13783_lock(mc13783);
 
-	if (mc13783->flags & MC13783_ADC_WORKING) {
+	if (mc13783->adcflags & MC13783_ADC_WORKING) {
 		ret = -EBUSY;
 		goto out;
 	}
 
-	mc13783->flags |= MC13783_ADC_WORKING;
+	mc13783->adcflags |= MC13783_ADC_WORKING;
 
 	mc13783_reg_read(mc13783, MC13783_ADC0, &old_adc0);
 
@@ -578,7 +577,7 @@ int mc13783_adc_do_conversion(struct mc13783 *mc13783, unsigned int mode,
 		/* restore TSMOD */
 		mc13783_reg_write(mc13783, MC13783_REG_ADC_0, old_adc0);
 
-	mc13783->flags &= ~MC13783_ADC_WORKING;
+	mc13783->adcflags &= ~MC13783_ADC_WORKING;
 out:
 	mc13783_unlock(mc13783);
 
@@ -675,14 +674,6 @@ err_revision:
 		return ret;
 	}
 
-	/* This should go away (BEGIN) */
-	if (pdata) {
-		mc13783->flags = pdata->flags;
-		mc13783->regulators = pdata->regulators;
-		mc13783->num_regulators = pdata->num_regulators;
-	}
-	/* This should go away (END) */
-
 	mc13783_unlock(mc13783);
 
 	if (pdata->flags & MC13783_USE_ADC)
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ