aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSelvin Xavier <selvin.xavier@avagotech.com>2015-10-20 04:47:56 -0400
committerDoug Ledford <dledford@redhat.com>2015-10-21 17:28:18 -0400
commit5a85f5e9d41bfd8a1fb5136d5ea2815fc75a5271 (patch)
tree44774a3a0cfa1ec197a2061791e18fc870c98acf
parent3dd9a5dc24c0bfb1453965a22f5234367a8936e3 (diff)
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: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com> Signed-off-by: Selvin Xavier <selvin.xavier@avagotech.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma.h1
-rw-r--r--drivers/infiniband/hw/ocrdma/ocrdma_main.c16
2 files changed, 2 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma.h b/drivers/infiniband/hw/ocrdma/ocrdma.h
index b4091ab48db0..8cd57c77e122 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma.h
@@ -278,7 +278,6 @@ struct ocrdma_dev {
278 u32 hba_port_num; 278 u32 hba_port_num;
279 279
280 struct list_head entry; 280 struct list_head entry;
281 struct rcu_head rcu;
282 int id; 281 int id;
283 u64 *stag_arr; 282 u64 *stag_arr;
284 u8 sl; /* service level */ 283 u8 sl; /* service level */
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
index 87aa55df7c82..cb1af0fb4051 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c
@@ -63,8 +63,6 @@ MODULE_DESCRIPTION(OCRDMA_ROCE_DRV_DESC " " OCRDMA_ROCE_DRV_VERSION);
63MODULE_AUTHOR("Emulex Corporation"); 63MODULE_AUTHOR("Emulex Corporation");
64MODULE_LICENSE("Dual BSD/GPL"); 64MODULE_LICENSE("Dual BSD/GPL");
65 65
66static LIST_HEAD(ocrdma_dev_list);
67static DEFINE_SPINLOCK(ocrdma_devlist_lock);
68static DEFINE_IDR(ocrdma_dev_id); 66static DEFINE_IDR(ocrdma_dev_id);
69 67
70void ocrdma_get_guid(struct ocrdma_dev *dev, u8 *guid) 68void 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 for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++) 323 for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++)
326 if (device_create_file(&dev->ibdev.dev, ocrdma_attributes[i])) 324 if (device_create_file(&dev->ibdev.dev, ocrdma_attributes[i]))
327 goto sysfs_err; 325 goto sysfs_err;
328 spin_lock(&ocrdma_devlist_lock);
329 list_add_tail_rcu(&dev->entry, &ocrdma_dev_list);
330 spin_unlock(&ocrdma_devlist_lock);
331 /* Init stats */ 326 /* Init stats */
332 ocrdma_add_port_stats(dev); 327 ocrdma_add_port_stats(dev);
333 /* Interrupt Moderation */ 328 /* Interrupt Moderation */
@@ -356,9 +351,8 @@ idr_err:
356 return NULL; 351 return NULL;
357} 352}
358 353
359static void ocrdma_remove_free(struct rcu_head *rcu) 354static void ocrdma_remove_free(struct ocrdma_dev *dev)
360{ 355{
361 struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu);
362 356
363 idr_remove(&ocrdma_dev_id, dev->id); 357 idr_remove(&ocrdma_dev_id, dev->id);
364 kfree(dev->mbx_cmd); 358 kfree(dev->mbx_cmd);
@@ -375,15 +369,9 @@ static void ocrdma_remove(struct ocrdma_dev *dev)
375 ib_unregister_device(&dev->ibdev); 369 ib_unregister_device(&dev->ibdev);
376 370
377 ocrdma_rem_port_stats(dev); 371 ocrdma_rem_port_stats(dev);
378
379 spin_lock(&ocrdma_devlist_lock);
380 list_del_rcu(&dev->entry);
381 spin_unlock(&ocrdma_devlist_lock);
382
383 ocrdma_free_resources(dev); 372 ocrdma_free_resources(dev);
384 ocrdma_cleanup_hw(dev); 373 ocrdma_cleanup_hw(dev);
385 374 ocrdma_remove_free(dev);
386 call_rcu(&dev->rcu, ocrdma_remove_free);
387} 375}
388 376
389static int ocrdma_open(struct ocrdma_dev *dev) 377static int ocrdma_open(struct ocrdma_dev *dev)