From 927f0751fc8be8a71c2d8b255522259d01a7fcef Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Tue, 18 Apr 2017 22:54:54 +0200 Subject: Rename struct device to struct rc_device --- rcm-server-keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'rcm-server-keymap.c') 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; -- cgit v1.2.3