linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Reid <preid@electromag.com.au>
To: realmz6@gmail.com, wsa@the-dreams.de, sre@kernel.org,
	preid@electromag.com.au,
	adi-buildroot-devel@lists.sourceforge.net,
	linux-i2c@vger.kernel.org, linux-pm@vger.kernel.org,
	jdelvare@suse.de, benjamin.tissoires@redhat.com
Subject: [RFC v2 1/3] i2c: smbus: move of_i2c_setup_smbus_alert declaration to i2c-core.h
Date: Tue, 28 Nov 2017 11:38:27 +0800	[thread overview]
Message-ID: <1511840309-37964-2-git-send-email-preid@electromag.com.au> (raw)
In-Reply-To: <1511840309-37964-1-git-send-email-preid@electromag.com.au>

This declaration isn't used by anything outside of the i2c-core at
present. In preparation for moving the smbus_alert code from it's
own module into the i2c-core move to i2c-core.h

Signed-off-by: Phil Reid <preid@electromag.com.au>
---
 drivers/i2c/i2c-core.h    |  9 +++++++++
 drivers/i2c/i2c-smbus.c   |  3 ++-
 include/linux/i2c-smbus.h | 10 ----------
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index 3d3d9bf..8ef0402 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -60,3 +60,12 @@ static inline void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) {
 static inline void of_i2c_register_devices(struct i2c_adapter *adap) { }
 #endif
 extern struct notifier_block i2c_of_notifier;
+
+#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF)
+int of_i2c_setup_smbus_alert(struct i2c_adapter *adap);
+#else
+static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap)
+{
+	return 0;
+}
+#endif
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index 5a1dd7f..c11a50e 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -25,6 +25,8 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 
+#include "i2c-core.h"
+
 struct i2c_smbus_alert {
 	struct work_struct	alert;
 	struct i2c_client	*ara;		/* Alert response address */
@@ -123,7 +125,6 @@ static void smbalert_work(struct work_struct *work)
 	alert = container_of(work, struct i2c_smbus_alert, alert);
 
 	smbus_alert(0, alert);
-
 }
 
 /* Setup SMBALERT# infrastructure */
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
index fb0e040..5f16a63 100644
--- a/include/linux/i2c-smbus.h
+++ b/include/linux/i2c-smbus.h
@@ -26,7 +26,6 @@
 #include <linux/spinlock.h>
 #include <linux/workqueue.h>
 
-
 /**
  * i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
  * @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0)
@@ -49,13 +48,4 @@ struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
 					 struct i2c_smbus_alert_setup *setup);
 int i2c_handle_smbus_alert(struct i2c_client *ara);
 
-#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF)
-int of_i2c_setup_smbus_alert(struct i2c_adapter *adap);
-#else
-static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap)
-{
-	return 0;
-}
-#endif
-
 #endif /* _LINUX_I2C_SMBUS_H */
-- 
1.8.3.1

  reply	other threads:[~2017-11-28  3:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-28  3:38 [RFC v2 0/3] i2c: core: move smbus_alert into i2c-core Phil Reid
2017-11-28  3:38 ` Phil Reid [this message]
2017-11-28  3:38 ` [RFC v2 2/3] i2c: Kconfig: rename variable I2C_SMBUS to I2C_SMBUS_ALERT Phil Reid
2017-11-28 22:08   ` Jean Delvare
2017-11-29  1:58     ` Phil Reid
2017-11-29 12:48       ` Jean Delvare
2017-11-30 10:31         ` Phil Reid
2017-11-28  3:38 ` [RFC v2 3/3] i2c: core: move smbus_alert module into i2c-core Phil Reid

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=1511840309-37964-2-git-send-email-preid@electromag.com.au \
    --to=preid@electromag.com.au \
    --cc=adi-buildroot-devel@lists.sourceforge.net \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=realmz6@gmail.com \
    --cc=sre@kernel.org \
    --cc=wsa@the-dreams.de \
    /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;
as well as URLs for NNTP newsgroup(s).