Skip to content

Commit 5fe448b

Browse files
author
Fox Snowpatch
committed
1 parent f85c105 commit 5fe448b

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

arch/powerpc/platforms/powermac/backlight.c

+3-11
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,10 @@ struct backlight_device *pmac_backlight;
5757
int pmac_has_backlight_type(const char *type)
5858
{
5959
struct device_node* bk_node = of_find_node_by_name(NULL, "backlight");
60+
int i = of_property_match_string(bk_node, "backlight-control", type);
6061

61-
if (bk_node) {
62-
const char *prop = of_get_property(bk_node,
63-
"backlight-control", NULL);
64-
if (prop && strncmp(prop, type, strlen(type)) == 0) {
65-
of_node_put(bk_node);
66-
return 1;
67-
}
68-
of_node_put(bk_node);
69-
}
70-
71-
return 0;
62+
of_node_put(bk_node);
63+
return i >= 0;
7264
}
7365

7466
static void pmac_backlight_key_worker(struct work_struct *work)

0 commit comments

Comments
 (0)