mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adam Belay <ambx1@neo.rr.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PnP Updates for 2.6.2-rc2
Date: Fri, 30 Jan 2004 00:01:55 +0000	[thread overview]
Message-ID: <20040130000155.GI12308@neo.rr.com> (raw)
In-Reply-To: <20040129235304.GA12308@neo.rr.com>

This patch adds some aditional information to sysfs for pnp cards.  It should be
useful for userland tools.

--- a/drivers/pnp/card.c	2004-01-29 23:08:49.000000000 +0000
+++ b/drivers/pnp/card.c	2004-01-29 23:03:23.000000000 +0000
@@ -139,6 +139,39 @@
 	kfree(card);
 }
 
+
+static ssize_t pnp_show_card_name(struct device *dmdev, char *buf)
+{
+	char *str = buf;
+	struct pnp_card *card = to_pnp_card(dmdev);
+	str += sprintf(str,"%s\n", card->name);
+	return (str - buf);
+}
+
+static DEVICE_ATTR(name,S_IRUGO,pnp_show_card_name,NULL);
+
+static ssize_t pnp_show_card_ids(struct device *dmdev, char *buf)
+{
+	char *str = buf;
+	struct pnp_card *card = to_pnp_card(dmdev);
+	struct pnp_id * pos = card->id;
+
+	while (pos) {
+		str += sprintf(str,"%s\n", pos->id);
+		pos = pos->next;
+	}
+	return (str - buf);
+}
+
+static DEVICE_ATTR(card_id,S_IRUGO,pnp_show_card_ids,NULL);
+
+static int pnp_interface_attach_card(struct pnp_card *card)
+{
+	device_create_file(&card->dev,&dev_attr_name);
+	device_create_file(&card->dev,&dev_attr_card_id);
+	return 0;
+}
+
 /**
  * pnp_add_card - adds a PnP card to the PnP Layer
  * @card: pointer to the card to add
@@ -158,6 +191,7 @@
 	error = device_register(&card->dev);
 
 	if (error == 0) {
+		pnp_interface_attach_card(card);
 		spin_lock(&pnp_lock);
 		list_add_tail(&card->global_list, &pnp_cards);
 		list_add_tail(&card->protocol_list, &card->protocol->cards);

  parent reply	other threads:[~2004-01-30  5:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29 23:53 Adam Belay
2004-01-29 23:55 ` Adam Belay
2004-01-29 23:56 ` Adam Belay
2004-01-29 23:57 ` Adam Belay
2004-01-29 23:57 ` Adam Belay
2004-01-29 23:59 ` Adam Belay
2004-01-29 23:59 ` Adam Belay
2004-01-30  0:00 ` Adam Belay
2004-01-30  0:01 ` Adam Belay [this message]
2004-01-30  0:02 ` Adam Belay

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=20040130000155.GI12308@neo.rr.com \
    --to=ambx1@neo.rr.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome