diff options
author | David Härdeman <david@hardeman.nu> | 2017-04-18 22:54:54 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2017-04-18 22:54:54 +0200 |
commit | 927f0751fc8be8a71c2d8b255522259d01a7fcef (patch) | |
tree | a4f59932b9a4df5ecdcb26014fc30e74aae05866 /rcm-server-keymap.c | |
parent | 0c5c949451f6f8f71e4489db19390ba6f931e2af (diff) |
Rename struct device to struct rc_device
Diffstat (limited to 'rcm-server-keymap.c')
-rw-r--r-- | rcm-server-keymap.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/rcm-server-keymap.c b/rcm-server-keymap.c index 84e8f7c..5374dda 100644 --- a/rcm-server-keymap.c +++ b/rcm-server-keymap.c @@ -343,7 +343,7 @@ out: } static int -keymaps_load_dir(struct device *device, int pfd, const char *path) +keymaps_load_dir(struct rc_device *rcdev, int pfd, const char *path) { _cleanup_closedir_ DIR *dir = NULL; int dfd; @@ -365,12 +365,12 @@ keymaps_load_dir(struct device *device, int pfd, const char *path) case DT_REG: case DT_LNK: case DT_UNKNOWN: - keymap = find_keymap_by_id(device, dent->d_name); + keymap = find_keymap_by_id(rcdev, dent->d_name); if (keymap) continue; keymap = keymap_read(dfd, path, dent->d_name); if (keymap) - list_add(&keymap->list, &device->keymaps); + list_add(&keymap->list, &rcdev->keymaps); break; default: break; @@ -381,12 +381,12 @@ keymaps_load_dir(struct device *device, int pfd, const char *path) } int -keymaps_load(struct device *device) +keymaps_load(struct rc_device *rcdev) { - char pdpath[strlen("per-device/") + strlen(device->name) + 1]; + char pdpath[strlen("per-device/") + strlen(rcdev->name) + 1]; _cleanup_close_ int dfd; - sprintf(pdpath, "per-device/%s", device->name); + sprintf(pdpath, "per-device/%s", rcdev->name); /* FIXME: This is just a temporary location */ dfd = open("./keymaps", O_PATH | O_DIRECTORY); @@ -394,9 +394,9 @@ keymaps_load(struct device *device) return -errno; printf("Loading per-device keymaps...\n"); - keymaps_load_dir(device, dfd, pdpath); + keymaps_load_dir(rcdev, dfd, pdpath); printf("Loading default keymaps...\n"); - keymaps_load_dir(device, dfd, "default"); + keymaps_load_dir(rcdev, dfd, "default"); return 0; } @@ -503,11 +503,11 @@ keymap_free(struct keymap *keymap) } struct keymap * -find_keymap_by_id(struct device *dev, const char *id) +find_keymap_by_id(struct rc_device *rcdev, const char *id) { struct keymap *keymap; - list_for_each_entry(keymap, &dev->keymaps, list) + list_for_each_entry(keymap, &rcdev->keymaps, list) if (!strcmp(keymap->id, id)) return keymap; |