Commit 5a85f5e9 authored by Selvin Xavier's avatar Selvin Xavier Committed by Doug Ledford

RDMA/ocrdma: Cleanup unused device list and rcu variables

ocrdma_dev_list is not used by the driver. So removing
the references of this variable. dev->rcu was introduced
for the ipv6 notifier for GID management. This is no longer
required as the GID management is outside the HW driver.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
Signed-off-by: default avatarSelvin Xavier <selvin.xavier@avagotech.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 3dd9a5dc
...@@ -278,7 +278,6 @@ struct ocrdma_dev { ...@@ -278,7 +278,6 @@ struct ocrdma_dev {
u32 hba_port_num; u32 hba_port_num;
struct list_head entry; struct list_head entry;
struct rcu_head rcu;
int id; int id;
u64 *stag_arr; u64 *stag_arr;
u8 sl; /* service level */ u8 sl; /* service level */
......
...@@ -63,8 +63,6 @@ MODULE_DESCRIPTION(OCRDMA_ROCE_DRV_DESC " " OCRDMA_ROCE_DRV_VERSION); ...@@ -63,8 +63,6 @@ MODULE_DESCRIPTION(OCRDMA_ROCE_DRV_DESC " " OCRDMA_ROCE_DRV_VERSION);
MODULE_AUTHOR("Emulex Corporation"); MODULE_AUTHOR("Emulex Corporation");
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
static LIST_HEAD(ocrdma_dev_list);
static DEFINE_SPINLOCK(ocrdma_devlist_lock);
static DEFINE_IDR(ocrdma_dev_id); static DEFINE_IDR(ocrdma_dev_id);
void ocrdma_get_guid(struct ocrdma_dev *dev, u8 *guid) void ocrdma_get_guid(struct ocrdma_dev *dev, u8 *guid)
...@@ -325,9 +323,6 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) ...@@ -325,9 +323,6 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++) for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++)
if (device_create_file(&dev->ibdev.dev, ocrdma_attributes[i])) if (device_create_file(&dev->ibdev.dev, ocrdma_attributes[i]))
goto sysfs_err; goto sysfs_err;
spin_lock(&ocrdma_devlist_lock);
list_add_tail_rcu(&dev->entry, &ocrdma_dev_list);
spin_unlock(&ocrdma_devlist_lock);
/* Init stats */ /* Init stats */
ocrdma_add_port_stats(dev); ocrdma_add_port_stats(dev);
/* Interrupt Moderation */ /* Interrupt Moderation */
...@@ -356,9 +351,8 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info) ...@@ -356,9 +351,8 @@ static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
return NULL; return NULL;
} }
static void ocrdma_remove_free(struct rcu_head *rcu) static void ocrdma_remove_free(struct ocrdma_dev *dev)
{ {
struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu);
idr_remove(&ocrdma_dev_id, dev->id); idr_remove(&ocrdma_dev_id, dev->id);
kfree(dev->mbx_cmd); kfree(dev->mbx_cmd);
...@@ -375,15 +369,9 @@ static void ocrdma_remove(struct ocrdma_dev *dev) ...@@ -375,15 +369,9 @@ static void ocrdma_remove(struct ocrdma_dev *dev)
ib_unregister_device(&dev->ibdev); ib_unregister_device(&dev->ibdev);
ocrdma_rem_port_stats(dev); ocrdma_rem_port_stats(dev);
spin_lock(&ocrdma_devlist_lock);
list_del_rcu(&dev->entry);
spin_unlock(&ocrdma_devlist_lock);
ocrdma_free_resources(dev); ocrdma_free_resources(dev);
ocrdma_cleanup_hw(dev); ocrdma_cleanup_hw(dev);
ocrdma_remove_free(dev);
call_rcu(&dev->rcu, ocrdma_remove_free);
} }
static int ocrdma_open(struct ocrdma_dev *dev) static int ocrdma_open(struct ocrdma_dev *dev)
......
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