Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add stub for hw_get_module_by_class

Signed-off-by: Carsten Munk <carsten.munk@jollamobile.com>
  • Loading branch information...
commit 8d015db1f6523a87097c838d9f06769c8095f94b 1 parent b302808
Carsten Munk authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 hardware/hardware.c
View
9 hardware/hardware.c
@@ -22,6 +22,8 @@ static void *_libhardware = NULL;
static int (*_hw_get_module)(const char *id, const struct hw_module_t **module) = NULL;
+static void (*_hw_get_module_by_class)(const char *class_id, const char *inst, const struct hw_module_t **module) = NULL;
+
#define HARDWARE_DLSYM(fptr, sym) do { if (_libhardware == NULL) { _init_lib_hardware(); }; if (*(fptr) == NULL) { *(fptr) = (void *) android_dlsym(_libhardware, sym); } } while (0)
static void _init_lib_hardware()
@@ -35,4 +37,11 @@ int hw_get_module(const char *id, const struct hw_module_t **module)
return (*_hw_get_module)(id, module);
}
+int hw_get_module_by_class(const char *class_id, const char *inst,
+ const struct hw_module_t **module)
+{
+ HARDWARE_DLSYM(&_hw_get_module_by_class, "hw_get_module_by_class");
+ (*_hw_get_module_by_class)(class_id, inst, module);
+}
+
// vim:ts=4:sw=4:noexpandtab
Please sign in to comment.
Something went wrong with that request. Please try again.