nodedev: Remove privateData from virNodeDeviceObj

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 <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2017-05-12 13:07:43 -04:00
parent 922af89e44
commit 5d3994d822
3 changed files with 0 additions and 19 deletions

View File

@ -335,8 +335,6 @@ struct _virNodeDeviceObj {
virMutex lock;
virNodeDeviceDefPtr def; /* device definition */
void *privateData; /* driver-specific private data */
void (*privateFree)(void *data); /* destructor for private data */
};

View File

@ -246,8 +246,6 @@ virNodeDeviceObjFree(virNodeDeviceObjPtr dev)
return;
virNodeDeviceDefFree(dev->def);
if (dev->privateFree)
(*dev->privateFree)(dev->privateData);
virMutexDestroy(&dev->lock);

View File

@ -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)
@ -446,12 +444,6 @@ gather_capabilities(LibHalContext *ctx, const char *udi,
return rv;
}
static void
free_udi(void *udi)
{
VIR_FREE(udi);
}
static void
dev_create(const char *udi)
{
@ -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(dev);
dev->privateData = privData;
dev->privateFree = free_udi;
objdef->sysfs_path = devicePath;
virNodeDeviceObjUnlock(dev);
@ -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();
}