[PATCH 2/3] mc13xxx: Hide private struct mc13xxx from other units
Alexander Shiyan
shc_work at mail.ru
Sat Aug 4 05:15:54 EDT 2012
Board support units must use only the provided functions.
Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
drivers/mfd/mc13xxx.c | 15 +++++++++++++++
include/mfd/mc13xxx.h | 13 +------------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 53d9b7c..8e3c0b0 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -32,6 +32,21 @@
#define DRIVERNAME "mc13xxx"
+enum mc13xxx_mode {
+ MC13XXX_MODE_I2C,
+ MC13XXX_MODE_SPI,
+};
+
+struct mc13xxx {
+ struct cdev cdev;
+ union {
+ struct i2c_client *client;
+ struct spi_device *spi;
+ };
+ enum mc13xxx_mode mode;
+ int revision;
+};
+
#define to_mc13xxx(a) container_of(a, struct mc13xxx, cdev)
static struct mc13xxx *mc_dev;
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 3770789..59042eb 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -150,18 +150,7 @@
#define MC13783_SW1B_SOFTSTART (1 << 17)
#define MC13783_SW_PLL_FACTOR(x) (((x) - 28) << 19)
-enum mc13xxx_mode {
- MC13XXX_MODE_I2C,
- MC13XXX_MODE_SPI,
-};
-
-struct mc13xxx {
- struct cdev cdev;
- struct i2c_client *client;
- struct spi_device *spi;
- enum mc13xxx_mode mode;
- int revision;
-};
+struct mc13xxx;
#ifdef CONFIG_MFD_MC13XXX
extern struct mc13xxx *mc13xxx_get(void);
--
1.7.3.4
More information about the barebox
mailing list