RDMA: Introduce and use rdma_device_to_ibdev()
Introduce and use rdma_device_to_ibdev() API for those drivers which are registering one sysfs group and also use in ib_core. In subsequent patch, device->provider_ibdev one-to-one mapping is no longer holds true during accessing sysfs entries. Therefore, introduce an API rdma_device_to_ibdev() that provides such information. Signed-off-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
这个提交包含在:
@@ -2139,9 +2139,8 @@ static int i40iw_dereg_mr(struct ib_mr *ib_mr)
|
||||
static ssize_t hw_rev_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct i40iw_ib_device *iwibdev = container_of(dev,
|
||||
struct i40iw_ib_device,
|
||||
ibdev.dev);
|
||||
struct i40iw_ib_device *iwibdev =
|
||||
rdma_device_to_drv_device(dev, struct i40iw_ib_device, ibdev);
|
||||
u32 hw_rev = iwibdev->iwdev->sc_dev.hw_rev;
|
||||
|
||||
return sprintf(buf, "%x\n", hw_rev);
|
||||
|
在新工单中引用
屏蔽一个用户