Skip to content

Commit

Permalink
Driver Core: bsg: add nodename for bsg driver
Browse files Browse the repository at this point in the history
This adds support to the BSG driver to report the proper device name to
userspace for the bsg devices.

Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Jan Blunck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kaysievers authored and gregkh committed Jun 16, 2009
1 parent 1ce8a0d commit 2bdf914
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,11 @@ EXPORT_SYMBOL_GPL(bsg_register_queue);

static struct cdev bsg_cdev;

static char *bsg_nodename(struct device *dev)
{
return kasprintf(GFP_KERNEL, "bsg/%s", dev_name(dev));
}

static int __init bsg_init(void)
{
int ret, i;
Expand All @@ -1085,6 +1090,7 @@ static int __init bsg_init(void)
ret = PTR_ERR(bsg_class);
goto destroy_kmemcache;
}
bsg_class->nodename = bsg_nodename;

ret = alloc_chrdev_region(&devid, 0, BSG_MAX_DEVS, "bsg");
if (ret)
Expand Down

0 comments on commit 2bdf914

Please sign in to comment.