mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
node_device_udev: Inline udevRemoveOneDevice
Inline `udevRemoveOneDevice` as it's used only once. Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
This commit is contained in:
parent
e6b70ae0c3
commit
d7c8908be8
@ -1485,16 +1485,6 @@ udevRemoveOneDeviceSysPath(const char *path)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
udevRemoveOneDevice(struct udev_device *device)
|
|
||||||
{
|
|
||||||
const char *path = udev_device_get_syspath(device);
|
|
||||||
|
|
||||||
return udevRemoveOneDeviceSysPath(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
udevSetParent(struct udev_device *device,
|
udevSetParent(struct udev_device *device,
|
||||||
virNodeDeviceDef *def)
|
virNodeDeviceDef *def)
|
||||||
@ -1778,8 +1768,11 @@ udevHandleOneDevice(struct udev_device *device)
|
|||||||
if (STREQ(action, "add") || STREQ(action, "change"))
|
if (STREQ(action, "add") || STREQ(action, "change"))
|
||||||
return udevAddOneDevice(device);
|
return udevAddOneDevice(device);
|
||||||
|
|
||||||
if (STREQ(action, "remove"))
|
if (STREQ(action, "remove")) {
|
||||||
return udevRemoveOneDevice(device);
|
const char *path = udev_device_get_syspath(device);
|
||||||
|
|
||||||
|
return udevRemoveOneDeviceSysPath(path);
|
||||||
|
}
|
||||||
|
|
||||||
if (STREQ(action, "move")) {
|
if (STREQ(action, "move")) {
|
||||||
const char *devpath_old = udevGetDeviceProperty(device, "DEVPATH_OLD");
|
const char *devpath_old = udevGetDeviceProperty(device, "DEVPATH_OLD");
|
||||||
|
Loading…
Reference in New Issue
Block a user