mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Greg KH <greg@kroah.com>
Subject: Re: hid: struct device - replace bus_id with dev_name(), dev_set_name()
Date: Thu, 30 Oct 2008 20:35:16 +0100	[thread overview]
Message-ID: <1225395316.21973.47.camel@nga.site> (raw)
In-Reply-To: <490A0A35.9060606@gmail.com>

On Thu, 2008-10-30 at 20:25 +0100, Jiri Slaby wrote:
> Kay Sievers napsal(a):
> > switch over to the new api, which will remove the 20 bytes array
> > and does no longer have a size limitation.
> 
> Cool!

> Could you left the comment above to remind us about removing this ugly hack
> later when the new non-limited api will be used?

Sure!

Thanks,
Kay



From: Kay Sievers <kay.sievers@vrfy.org>
Subject: hid: struct device - replace bus_id with dev_name(), dev_set_name()

CC: Jiri Kosina <jkosina@suse.cz>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org>
---

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 1903e75..27f1e16 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1613,9 +1613,10 @@ int hid_add_device(struct hid_device *hdev)
 	if (hid_ignore(hdev))
 		return -ENODEV;
 
-	/* XXX hack, any other cleaner solution < 20 bus_id bytes? */
-	sprintf(hdev->dev.bus_id, "%04X:%04X:%04X.%04X", hdev->bus,
-			hdev->vendor, hdev->product, atomic_inc_return(&id));
+	/* XXX hack, any other cleaner solution after the driver core
+	 * is converted to allow more than 20 bytes as the device name? */
+	dev_set_name(&hdev->dev, "%04X:%04X:%04X.%04X", hdev->bus,
+		     hdev->vendor, hdev->product, atomic_inc_return(&id));
 
 	ret = device_add(&hdev->dev);
 	if (!ret)



  reply	other threads:[~2008-10-30 19:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 16:55 Kay Sievers
2008-10-30 19:25 ` Jiri Slaby
2008-10-30 19:35   ` Kay Sievers [this message]
2008-10-30 23:10     ` Jiri Kosina
2008-10-30 23:16       ` Kay Sievers
2008-10-30 23:19         ` Jiri Kosina

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=1225395316.21973.47.camel@nga.site \
    --to=kay.sievers@vrfy.org \
    --cc=greg@kroah.com \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --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

all inboxes | Powered by JetHome®