]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
uio_hv_generic: make ring buffer attribute for primary channel
authorStephen Hemminger <stephen@networkplumber.org>
Mon, 16 Apr 2018 18:19:25 +0000 (11:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 10:43:48 +0000 (12:43 +0200)
The primary channel also needs a ring buffer attribute. This allows
application to check if kernel supports uio sub channels, and also
makes all channels use consistent API.

Fixes: 37b96a4931db ("uio_hv_generic: support sub-channels")
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_hv_generic.c

index 7ff659dff11db6604762dd934f6560c29112bd7e..972a42dd2a461645bda788d526ef6721f214071d 100644 (file)
@@ -326,6 +326,11 @@ hv_uio_probe(struct hv_device *dev,
        vmbus_set_chn_rescind_callback(dev->channel, hv_uio_rescind);
        vmbus_set_sc_create_callback(dev->channel, hv_uio_new_channel);
 
+       ret = sysfs_create_bin_file(&dev->channel->kobj, &ring_buffer_bin_attr);
+       if (ret)
+               dev_notice(&dev->device,
+                          "sysfs create ring bin file failed; %d\n", ret);
+
        hv_set_drvdata(dev, pdata);
 
        return 0;