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 fixes for 2.6.4
Date: Mon, 15 Mar 2004 14:56:33 -0800	[thread overview]
Message-ID: <1079391393850@kroah.com> (raw)
In-Reply-To: <10793913932709@kroah.com>

ChangeSet 1.1597.1.12, 2004/03/03 10:09:09-08:00, greg@kroah.com

[PATCH] I2C: show adapter name in i2c-dev class directory to make it easier for userspace tools.


 drivers/i2c/i2c-dev.c |    8 ++++++++
 1 files changed, 8 insertions(+)


diff -Nru a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
--- a/drivers/i2c/i2c-dev.c	Mon Mar 15 14:35:31 2004
+++ b/drivers/i2c/i2c-dev.c	Mon Mar 15 14:35:31 2004
@@ -124,6 +124,13 @@
 }
 static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
 
+static ssize_t show_adapter_name(struct class_device *class_dev, char *buf)
+{
+	struct i2c_dev *i2c_dev = to_i2c_dev(class_dev);
+	return sprintf(buf, "%s\n", i2c_dev->adap->name);
+}
+static CLASS_DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
+
 static ssize_t i2cdev_read (struct file *file, char __user *buf, size_t count,
                             loff_t *offset)
 {
@@ -459,6 +466,7 @@
 	if (retval)
 		goto error;
 	class_device_create_file(&i2c_dev->class_dev, &class_device_attr_dev);
+	class_device_create_file(&i2c_dev->class_dev, &class_device_attr_name);
 	return 0;
 error:
 	return_i2c_dev(i2c_dev);


  reply	other threads:[~2004-03-16  0:17 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 22:48 [BK PATCH] i2c driver fixes for 2.6.4 Greg KH
2004-03-15 22:56 ` [PATCH] " Greg KH
2004-03-15 22:56   ` Greg KH
2004-03-15 22:56     ` Greg KH
2004-03-15 22:56       ` Greg KH
2004-03-15 22:56         ` Greg KH
2004-03-15 22:56           ` Greg KH
2004-03-15 22:56             ` Greg KH
2004-03-15 22:56               ` Greg KH
2004-03-15 22:56                 ` Greg KH
2004-03-15 22:56                   ` Greg KH
2004-03-15 22:56                     ` Greg KH
2004-03-15 22:56                       ` Greg KH
2004-03-15 22:56                         ` Greg KH
2004-03-15 22:56                           ` Greg KH
2004-03-15 22:56                             ` Greg KH
2004-03-15 22:56                               ` Greg KH
2004-03-15 22:56                                 ` Greg KH
2004-03-15 22:56                                   ` Greg KH
2004-03-15 22:56                                     ` Greg KH
2004-03-15 22:56                                       ` Greg KH
2004-03-15 22:56                                         ` Greg KH
2004-03-15 22:56                                           ` Greg KH
2004-03-15 22:56                                             ` Greg KH [this message]
2004-03-15 22:56                                               ` Greg KH
2004-03-15 22:56                                                 ` Greg KH
2004-03-15 22:56                                                   ` Greg KH
2004-03-15 22:56                                                     ` Greg KH
2004-03-15 22:56                                                       ` Greg KH
2004-03-15 22:56                                                         ` Greg KH
2004-03-15 22:56                                                           ` Greg KH
2004-03-15 22:56                                                             ` Greg KH
2004-03-15 22:56                                                               ` Greg KH
2004-03-15 22:56                                                                 ` Greg KH
2004-03-15 22:56                                                                   ` Greg KH
2004-03-15 22:56                                                                     ` Greg KH
2004-03-15 22:56                                                                       ` Greg KH
2004-03-15 22:56                                                                         ` Greg KH
2004-03-15 22:56                                                                           ` Greg KH
2004-03-15 22:56                                                                             ` Greg KH
2004-03-15 22:56                                                                               ` Greg KH
2004-03-15 22:56                                                                                 ` Greg KH
2004-03-15 22: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=1079391393850@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