summaryrefslogtreecommitdiff
path: root/config/udev.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-07-15 17:31:58 -0700
committerKeith Packard <keithp@keithp.com>2014-07-17 17:10:48 -0700
commit60c05ce1ab5d9dc7c034b6b3723f43a42ea637d8 (patch)
tree0b688aa26d7d635a4d52086db766948b484a3740 /config/udev.c
parent55f5bfb578e934319d1308cbb56c900c5ac7cfa7 (diff)
config: Replace OdevAttributes linked list with struct
OdevAttributes are a fixed set of values with known types; instead of storing them in a linked list and requiring accessor/settor functions, replace the list header, struct OdevAttributes, with a struct that directly contains the values. This provides for compile-time typechecking of the values, eliminates a significant amount of code and generally simplifies using this datatype. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'config/udev.c')
-rw-r--r--config/udev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/config/udev.c b/config/udev.c
index a1b72c13b..1e4a9d7a6 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -462,12 +462,12 @@ config_udev_odev_setup_attribs(const char *path, const char *syspath,
int major, int minor,
config_odev_probe_proc_ptr probe_callback)
{
- struct OdevAttributes *attribs = config_odev_allocate_attribute_list();
+ struct OdevAttributes *attribs = config_odev_allocate_attributes();
- config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path);
- config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath);
- config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MAJOR, major);
- config_odev_add_int_attribute(attribs, ODEV_ATTRIB_MINOR, minor);
+ attribs->path = XNFstrdup(path);
+ attribs->syspath = XNFstrdup(syspath);
+ attribs->major = major;
+ attribs->minor = minor;
/* ownership of attribs is passed to probe layer */
probe_callback(attribs);