From: Alexander Shiyan <shc_work@mail.ru>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] mc13xxx: Hide private struct mc13xxx from other units
Date: Sat, 4 Aug 2012 13:15:54 +0400 [thread overview]
Message-ID: <1344071755-6733-2-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1344071755-6733-1-git-send-email-shc_work@mail.ru>
Board support units must use only the provided functions.
Signed-off-by: Alexander Shiyan <shc_work@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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-08-04 9:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-04 9:15 [PATCH 1/3] mc13xxx: Added mc13xxx_revision() function Alexander Shiyan
2012-08-04 9:15 ` Alexander Shiyan [this message]
2012-08-04 9:15 ` [PATCH 3/3] mc13xxx: Fixed memory leak Alexander Shiyan
2012-08-09 6:38 ` Sascha Hauer
2012-08-09 15:33 ` Alexander Shiyan
2012-08-10 8:44 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344071755-6733-2-git-send-email-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox