diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-04-30 09:23:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:26 -0400 |
commit | 6fd4693375b6e1001c69e78f5aefd44bf5aa7084 (patch) | |
tree | 7f2336a020cfb070f7defe7b2c99f38248d0a21d /drivers/char | |
parent | 7a9d56f6a459472bc4383aeb85612d72e79d1818 (diff) |
Driver Core: raw: add nodename for raw devices
This adds support to the raw driver to report the proper device name to
userspace for the raw devices.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/raw.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c index db32f0e4c7dd..05f9d18b9361 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c | |||
@@ -261,6 +261,11 @@ static const struct file_operations raw_ctl_fops = { | |||
261 | 261 | ||
262 | static struct cdev raw_cdev; | 262 | static struct cdev raw_cdev; |
263 | 263 | ||
264 | static char *raw_nodename(struct device *dev) | ||
265 | { | ||
266 | return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); | ||
267 | } | ||
268 | |||
264 | static int __init raw_init(void) | 269 | static int __init raw_init(void) |
265 | { | 270 | { |
266 | dev_t dev = MKDEV(RAW_MAJOR, 0); | 271 | dev_t dev = MKDEV(RAW_MAJOR, 0); |
@@ -284,6 +289,7 @@ static int __init raw_init(void) | |||
284 | ret = PTR_ERR(raw_class); | 289 | ret = PTR_ERR(raw_class); |
285 | goto error_region; | 290 | goto error_region; |
286 | } | 291 | } |
292 | raw_class->nodename = raw_nodename; | ||
287 | device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); | 293 | device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); |
288 | 294 | ||
289 | return 0; | 295 | return 0; |