It was only ever used in node_device_hal.c which really never used it
anyway since the NODE_DEV_UDI was never referenced.  Remove free_udi()
and @privData as well as the references to obj->privateData & obj->privateFree.

Signed-off-by: John Ferlan <jfer...@redhat.com>
---
 src/conf/node_device_conf.h       |  2 --
 src/conf/virnodedeviceobj.c       |  2 --
 src/node_device/node_device_hal.c | 15 ---------------
 3 files changed, 19 deletions(-)

diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h
index 5743f9d..0ab2b96 100644
--- a/src/conf/node_device_conf.h
+++ b/src/conf/node_device_conf.h
@@ -318,8 +318,6 @@ struct _virNodeDeviceObj {
     virMutex lock;
 
     virNodeDeviceDefPtr def;           /* device definition */
-    void *privateData;                 /* driver-specific private data */
-    void (*privateFree)(void *data);   /* destructor for private data */
 
 };
 
diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 1b9d032..a7e51ef 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -248,8 +248,6 @@ virNodeDeviceObjFree(virNodeDeviceObjPtr obj)
         return;
 
     virNodeDeviceDefFree(obj->def);
-    if (obj->privateFree)
-        (*obj->privateFree)(obj->privateData);
 
     virMutexDestroy(&obj->lock);
 
diff --git a/src/node_device/node_device_hal.c 
b/src/node_device/node_device_hal.c
index cde1c7b..e9031ea 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -52,8 +52,6 @@ VIR_LOG_INIT("node_device.node_device_hal");
 
 #define DRV_STATE_HAL_CTX(ds) ((LibHalContext *)((ds)->privateData))
 
-#define NODE_DEV_UDI(obj) ((const char *)((obj)->privateData)
-
 
 static const char *
 hal_name(const char *udi)
@@ -447,12 +445,6 @@ gather_capabilities(LibHalContext *ctx, const char *udi,
 }
 
 static void
-free_udi(void *udi)
-{
-    VIR_FREE(udi);
-}
-
-static void
 dev_create(const char *udi)
 {
     LibHalContext *ctx;
@@ -462,12 +454,8 @@ dev_create(const char *udi)
     virNodeDeviceDefPtr objdef;
     const char *name = hal_name(udi);
     int rv;
-    char *privData;
     char *devicePath = NULL;
 
-    if (VIR_STRDUP(privData, udi) < 0)
-        return;
-
     nodeDeviceLock();
     ctx = DRV_STATE_HAL_CTX(driver);
 
@@ -500,8 +488,6 @@ dev_create(const char *udi)
     }
     objdef = virNodeDeviceObjGetDef(obj);
 
-    obj->privateData = privData;
-    obj->privateFree = free_udi;
     objdef->sysfs_path = devicePath;
 
     virNodeDeviceObjUnlock(obj);
@@ -512,7 +498,6 @@ dev_create(const char *udi)
  failure:
     VIR_DEBUG("FAILED TO ADD dev %s", name);
  cleanup:
-    VIR_FREE(privData);
     virNodeDeviceDefFree(def);
     nodeDeviceUnlock();
 }
-- 
2.9.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to