We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f85c105 commit 5fe448bCopy full SHA for 5fe448b
arch/powerpc/platforms/powermac/backlight.c
@@ -57,18 +57,10 @@ struct backlight_device *pmac_backlight;
57
int pmac_has_backlight_type(const char *type)
58
{
59
struct device_node* bk_node = of_find_node_by_name(NULL, "backlight");
60
+ int i = of_property_match_string(bk_node, "backlight-control", type);
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
69
70
-
71
- return 0;
+ of_node_put(bk_node);
+ return i >= 0;
72
}
73
74
static void pmac_backlight_key_worker(struct work_struct *work)
0 commit comments