mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
sd-device: enumerator - don't expose add_device()
This is rarely, if ever, used. Drop it from the new public API and only keep it for the legacy API. Suggested by David Herrmann.
This commit is contained in:
parent
c32eb440ba
commit
19c9df4492
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
int device_enumerator_scan_devices(sd_device_enumerator *enumeartor);
|
int device_enumerator_scan_devices(sd_device_enumerator *enumeartor);
|
||||||
int device_enumerator_scan_subsystems(sd_device_enumerator *enumeartor);
|
int device_enumerator_scan_subsystems(sd_device_enumerator *enumeartor);
|
||||||
|
int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device);
|
||||||
sd_device *device_enumerator_get_first(sd_device_enumerator *enumerator);
|
sd_device *device_enumerator_get_first(sd_device_enumerator *enumerator);
|
||||||
sd_device *device_enumerator_get_next(sd_device_enumerator *enumerator);
|
sd_device *device_enumerator_get_next(sd_device_enumerator *enumerator);
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ static int device_compare(const void *_a, const void *_b) {
|
|||||||
return strcmp(devpath_a, devpath_b);
|
return strcmp(devpath_a, devpath_b);
|
||||||
}
|
}
|
||||||
|
|
||||||
_public_ int sd_device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device) {
|
int device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert_return(enumerator, -EINVAL);
|
assert_return(enumerator, -EINVAL);
|
||||||
@ -544,7 +544,7 @@ static int enumerator_scan_dir_and_add_devices(sd_device_enumerator *enumerator,
|
|||||||
if (!match_sysattr(enumerator, device))
|
if (!match_sysattr(enumerator, device))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
k = sd_device_enumerator_add_device(enumerator, device);
|
k = device_enumerator_add_device(enumerator, device);
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
r = k;
|
r = k;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ static int enumerator_scan_devices_tag(sd_device_enumerator *enumerator, const c
|
|||||||
if (!match_sysattr(enumerator, device))
|
if (!match_sysattr(enumerator, device))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
k = sd_device_enumerator_add_device(enumerator, device);
|
k = device_enumerator_add_device(enumerator, device);
|
||||||
if (k < 0) {
|
if (k < 0) {
|
||||||
r = k;
|
r = k;
|
||||||
continue;
|
continue;
|
||||||
@ -727,7 +727,7 @@ static int parent_add_child(sd_device_enumerator *enumerator, const char *path)
|
|||||||
if (!match_sysattr(enumerator, device))
|
if (!match_sysattr(enumerator, device))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
r = sd_device_enumerator_add_device(enumerator, device);
|
r = device_enumerator_add_device(enumerator, device);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ _public_ int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, c
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = sd_device_enumerator_add_device(udev_enumerate->enumerator, device);
|
r = device_enumerator_add_device(udev_enumerate->enumerator, device);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
@ -81,8 +81,6 @@ int sd_device_enumerator_new(sd_device_enumerator **ret);
|
|||||||
sd_device_enumerator *sd_device_enumerator_ref(sd_device_enumerator *enumerator);
|
sd_device_enumerator *sd_device_enumerator_ref(sd_device_enumerator *enumerator);
|
||||||
sd_device_enumerator *sd_device_enumerator_unref(sd_device_enumerator *enumerator);
|
sd_device_enumerator *sd_device_enumerator_unref(sd_device_enumerator *enumerator);
|
||||||
|
|
||||||
int sd_device_enumerator_add_device(sd_device_enumerator *enumerator, sd_device *device);
|
|
||||||
|
|
||||||
sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator);
|
sd_device *sd_device_enumerator_get_device_first(sd_device_enumerator *enumerator);
|
||||||
sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator);
|
sd_device *sd_device_enumerator_get_device_next(sd_device_enumerator *enumerator);
|
||||||
sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator);
|
sd_device *sd_device_enumerator_get_subsystem_first(sd_device_enumerator *enumerator);
|
||||||
|
Loading…
Reference in New Issue
Block a user