summaryrefslogtreecommitdiffstats
path: root/hardware.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-01-13 23:43:23 -0800
committerColin Cross <ccross@android.com>2014-01-13 23:43:23 -0800
commitf7d761ca34578d662d87bc1f883f6eacad86bf51 (patch)
tree413be84d435da10b3fe71073fdbc6a538d805f7b /hardware.c
parente0c252ae43490cc324b89f6d7cbaa33af8ff341d (diff)
downloadhardware_libhardware-f7d761ca34578d662d87bc1f883f6eacad86bf51.tar.gz
hardware_libhardware-f7d761ca34578d662d87bc1f883f6eacad86bf51.tar.bz2
hardware_libhardware-f7d761ca34578d662d87bc1f883f6eacad86bf51.zip
hardware: fix check for ro.hardware.<class> property
Replace == with >, property_get returns the length of the property if found. Change-Id: I4b8fe8f8dba578112d21eee5dc64be4aa27f3bfb
Diffstat (limited to 'hardware.c')
-rw-r--r--hardware.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hardware.c b/hardware.c
index da89dd9..f835fda 100644
--- a/hardware.c
+++ b/hardware.c
@@ -160,7 +160,7 @@ int hw_get_module_by_class(const char *class_id, const char *inst,
/* First try a property specific to the class and possibly instance */
snprintf(prop_name, sizeof(prop_name), "ro.hardware.%s", name);
- if (property_get(prop_name, prop, NULL) == 0) {
+ if (property_get(prop_name, prop, NULL) > 0) {
if (hw_module_exists(path, sizeof(path), name, prop) == 0) {
goto found;
}