Commit 68f5f996 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] IB: fix up major/minor sysfs interface for IB core

Current IB code doesn't work with userspace programs that listen only to
the kernel event netlink socket as it is trying to create its own dev
interface.  This small patch fixes this problem, and removes some
unneeded code as the driver core handles this logic for you
automatically.
Acked-by: default avatarSean Hefty <sean.hefty@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0650fd58
...@@ -1319,15 +1319,6 @@ static struct class ucm_class = { ...@@ -1319,15 +1319,6 @@ static struct class ucm_class = {
.release = ib_ucm_release_class_dev .release = ib_ucm_release_class_dev
}; };
static ssize_t show_dev(struct class_device *class_dev, char *buf)
{
struct ib_ucm_device *dev;
dev = container_of(class_dev, struct ib_ucm_device, class_dev);
return print_dev_t(buf, dev->dev.dev);
}
static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
static ssize_t show_ibdev(struct class_device *class_dev, char *buf) static ssize_t show_ibdev(struct class_device *class_dev, char *buf)
{ {
struct ib_ucm_device *dev; struct ib_ucm_device *dev;
...@@ -1364,14 +1355,12 @@ static void ib_ucm_add_one(struct ib_device *device) ...@@ -1364,14 +1355,12 @@ static void ib_ucm_add_one(struct ib_device *device)
ucm_dev->class_dev.class = &ucm_class; ucm_dev->class_dev.class = &ucm_class;
ucm_dev->class_dev.dev = device->dma_device; ucm_dev->class_dev.dev = device->dma_device;
ucm_dev->class_dev.devt = ucm_dev->dev.dev;
snprintf(ucm_dev->class_dev.class_id, BUS_ID_SIZE, "ucm%d", snprintf(ucm_dev->class_dev.class_id, BUS_ID_SIZE, "ucm%d",
ucm_dev->devnum); ucm_dev->devnum);
if (class_device_register(&ucm_dev->class_dev)) if (class_device_register(&ucm_dev->class_dev))
goto err_cdev; goto err_cdev;
if (class_device_create_file(&ucm_dev->class_dev,
&class_device_attr_dev))
goto err_class;
if (class_device_create_file(&ucm_dev->class_dev, if (class_device_create_file(&ucm_dev->class_dev,
&class_device_attr_ibdev)) &class_device_attr_ibdev))
goto err_class; goto err_class;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment