Message ID | ede25e03-7a14-4787-ae1b-4fc9290add5a@web.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 2e716f5cdebed2fb98cafffaf626645c2e922dbb |
Headers | show |
Series | powermac: Use of_property_match_string() in pmac_has_backlight_type() | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_ppctests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_selftests | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 5 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 21 jobs. |
On Fri, 11 Oct 2024 18:18:42 +0200, Markus Elfring wrote: > Replace an of_get_property() call by of_property_match_string() > so that this function implementation can be simplified. > > Applied to powerpc/next. [1/1] powermac: Use of_property_match_string() in pmac_has_backlight_type() https://git.kernel.org/powerpc/c/2e716f5cdebed2fb98cafffaf626645c2e922dbb cheers
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index 12bc01353bd3..79741370c40c 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c @@ -57,18 +57,10 @@ struct backlight_device *pmac_backlight; int pmac_has_backlight_type(const char *type) { struct device_node* bk_node = of_find_node_by_name(NULL, "backlight"); + int i = of_property_match_string(bk_node, "backlight-control", type); - if (bk_node) { - const char *prop = of_get_property(bk_node, - "backlight-control", NULL); - if (prop && strncmp(prop, type, strlen(type)) == 0) { - of_node_put(bk_node); - return 1; - } - of_node_put(bk_node); - } - - return 0; + of_node_put(bk_node); + return i >= 0; } static void pmac_backlight_key_worker(struct work_struct *work)