public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, sensors@stimpy.netroedge.com
Subject: Re: [PATCH] i2c driver changes for 2.5.64
Date: Thu, 13 Mar 2003 16:55 -0800	[thread overview]
Message-ID: <1047603324728@kroah.com> (raw)
In-Reply-To: <10476033233796@kroah.com>

ChangeSet 1.1112, 2003/03/13 12:26:39-08:00, greg@kroah.com

i2c: add i2c sysfs bus support.


 drivers/i2c/i2c-core.c |   33 ++++++++++++++++++++++++++++++---
 include/linux/i2c.h    |    3 +++
 2 files changed, 33 insertions(+), 3 deletions(-)


diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c	Thu Mar 13 16:57:09 2003
+++ b/drivers/i2c/i2c-core.c	Thu Mar 13 16:57:09 2003
@@ -598,10 +598,37 @@
 {
 	remove_proc_entry("i2c",proc_bus);
 }
+#else
+static int __init i2cproc_init(void) { return 0; }
+static void __exit i2cproc_cleanup(void) { }
+#endif /* CONFIG_PROC_FS */
 
-module_init(i2cproc_init);
-module_exit(i2cproc_cleanup);
-#endif /* def CONFIG_PROC_FS */
+/* match always succeeds, as we want the probe() to tell if we really accept this match */
+static int i2c_device_match(struct device *dev, struct device_driver *drv)
+{
+	return 1;
+}
+
+struct bus_type i2c_bus_type = {
+	.name =		"i2c",
+	.match =	i2c_device_match,
+};
+
+
+static int __init i2c_init(void)
+{
+	bus_register(&i2c_bus_type);
+	return i2cproc_init();
+}
+
+static void __exit i2c_exit(void)
+{
+	i2cproc_cleanup();
+	bus_unregister(&i2c_bus_type);
+}
+
+module_init(i2c_init);
+module_exit(i2c_exit);
 
 /* ----------------------------------------------------
  * the functional interface to the i2c busses.
diff -Nru a/include/linux/i2c.h b/include/linux/i2c.h
--- a/include/linux/i2c.h	Thu Mar 13 16:57:09 2003
+++ b/include/linux/i2c.h	Thu Mar 13 16:57:09 2003
@@ -34,6 +34,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/i2c-id.h>
+#include <linux/device.h>	/* for struct device */
 #include <asm/semaphore.h>
 
 /* --- General options ------------------------------------------------	*/
@@ -143,6 +144,8 @@
 	 */
 	int (*command)(struct i2c_client *client,unsigned int cmd, void *arg);
 };
+
+extern struct bus_type i2c_bus_type;
 
 /*
  * i2c_client identifies a single device (i.e. chip) that is connected to an 


  reply	other threads:[~2003-03-14  0:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-14  0:50 [BK PATCH] i2c driver changes for 2.5.64 Greg KH
2003-03-14  0:55 ` [PATCH] " Greg KH
2003-03-14  0:55   ` Greg KH
2003-03-14  0:55     ` Greg KH
2003-03-14  0:55       ` Greg KH
2003-03-14  0:55         ` Greg KH
2003-03-14  0:55           ` Greg KH
2003-03-14  0:55             ` Greg KH
2003-03-14  0:55               ` Greg KH [this message]
2003-03-14  0:55                 ` Greg KH
2003-03-14  0:55                   ` Greg KH
2003-03-15  9:49                     ` Vojtech Pavlik
2003-03-15 21:46                       ` Greg KH
2003-03-15 22:06                         ` Vojtech Pavlik
2003-03-14  8:28       ` Christoph Hellwig
2003-03-14  8:21     ` Christoph Hellwig
2003-03-14  8:53       ` Greg KH
2003-03-14  8:19   ` Christoph Hellwig
2003-03-14  8:56     ` Greg KH

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=1047603324728@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /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