]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/infiniband/hw/ocrdma/ocrdma_main.c
RDMA: Introduce and use rdma_device_to_ibdev()
[linux.git] / drivers / infiniband / hw / ocrdma / ocrdma_main.c
index f45b996f617fae5ee0cc8373d22cd8f281cfa36c..b0491b9ecfe41cb1eb19bba6294278f045c849f8 100644 (file)
@@ -118,7 +118,8 @@ static void get_dev_fw_str(struct ib_device *device, char *str)
 static ssize_t hw_rev_show(struct device *device,
                           struct device_attribute *attr, char *buf)
 {
-       struct ocrdma_dev *dev = dev_get_drvdata(device);
+       struct ocrdma_dev *dev =
+               rdma_device_to_drv_device(device, struct ocrdma_dev, ibdev);
 
        return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->nic_info.pdev->vendor);
 }
@@ -127,7 +128,8 @@ static DEVICE_ATTR_RO(hw_rev);
 static ssize_t hca_type_show(struct device *device,
                             struct device_attribute *attr, char *buf)
 {
-       struct ocrdma_dev *dev = dev_get_drvdata(device);
+       struct ocrdma_dev *dev =
+               rdma_device_to_drv_device(device, struct ocrdma_dev, ibdev);
 
        return scnprintf(buf, PAGE_SIZE, "%s\n", &dev->model_number[0]);
 }