hardware/liblights
Revision | 2d132222d7333b7fa1e89b6bf03f4a1d7a626a2f (tree) |
---|---|
Time | 2013-01-08 19:53:38 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
fix compatibility issues of jb-x86
* LOGx -> ALOGx
* Remove constness of struct hw_module_t
@@ -61,7 +61,7 @@ static int write_int(char* path, int value) | ||
61 | 61 | return amt == -1 ? -errno : 0; |
62 | 62 | } else { |
63 | 63 | if (already_warned == 0) { |
64 | - LOGE("write_int failed to open %s\n", path); | |
64 | + ALOGE("write_int failed to open %s\n", path); | |
65 | 65 | already_warned = 1; |
66 | 66 | } |
67 | 67 | return -errno; |
@@ -95,7 +95,7 @@ static int set_light_backlight(struct light_device_t* dev, struct light_state_t | ||
95 | 95 | { |
96 | 96 | int err = 0; |
97 | 97 | int brightness = rgb_to_brightness16(state) / (65536 / (max_brightness + 1)); |
98 | - LOGV("Setting display brightness to %d", brightness); | |
98 | + ALOGV("Setting display brightness to %d", brightness); | |
99 | 99 | |
100 | 100 | pthread_mutex_lock(&g_lock); |
101 | 101 | err = write_int(brightness_file, (brightness)); |
@@ -121,23 +121,23 @@ static int open_lights(const struct hw_module_t* module, char const* name, struc | ||
121 | 121 | char max_b_file[PROPERTY_VALUE_MAX] = { '\0' }; |
122 | 122 | if (property_get(LLP_MAX_BRIGHTNESS, max_b_file, NULL)) { |
123 | 123 | if (!sscanf(max_b_file, "%d", &max_brightness)) { |
124 | - LOGE("%s system property is set to '%s', this could not be parsed as an integer!", LLP_MAX_BRIGHTNESS, max_b_file); | |
124 | + ALOGE("%s system property is set to '%s', this could not be parsed as an integer!", LLP_MAX_BRIGHTNESS, max_b_file); | |
125 | 125 | return -EINVAL; |
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | if (property_get(LLP_MAX_BRIGHTNESS_FILE, max_b_file, DEF_LLP_MAX_BRIGHTNESS_FILE)) { |
129 | 129 | max_brightness = read_int(max_b_file); |
130 | 130 | } else { |
131 | - LOGE("%s system property not set", LLP_MAX_BRIGHTNESS_FILE); | |
131 | + ALOGE("%s system property not set", LLP_MAX_BRIGHTNESS_FILE); | |
132 | 132 | return -EINVAL; |
133 | 133 | } |
134 | 134 | } |
135 | - LOGV("Read max display brightness of %d", max_brightness); | |
135 | + ALOGV("Read max display brightness of %d", max_brightness); | |
136 | 136 | if (max_brightness < 1) { |
137 | 137 | max_brightness = 255; |
138 | 138 | } |
139 | 139 | if (!property_get(LLP_BRIGHTNESS_FILE, brightness_file, DEF_LLP_BRIGHTNESS_FILE)) { |
140 | - LOGE("%s system property not set", LLP_BRIGHTNESS_FILE); | |
140 | + ALOGE("%s system property not set", LLP_BRIGHTNESS_FILE); | |
141 | 141 | return -EINVAL; |
142 | 142 | } |
143 | 143 | } else { |
@@ -164,7 +164,7 @@ static struct hw_module_methods_t lights_module_methods = { | ||
164 | 164 | .open = open_lights, |
165 | 165 | }; |
166 | 166 | |
167 | -const struct hw_module_t HAL_MODULE_INFO_SYM = { | |
167 | +struct hw_module_t HAL_MODULE_INFO_SYM = { | |
168 | 168 | .tag = HARDWARE_MODULE_TAG, |
169 | 169 | .version_major = 1, |
170 | 170 | .version_minor = 0, |