Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

cpufreq: qcom-nvmem: Convert to of_machine_get_match()

Use the of_machine_get_match() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://patch.msgid.link/886a603a7a1de6c8cb14ee0783ee0bceea4d914a.1772468323.git.geert+renesas@glider.be
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Geert Uytterhoeven and committed by
Rob Herring (Arm)
8cd94ead 1838e092

+2 -14
+2 -14
drivers/cpufreq/qcom-cpufreq-nvmem.c
··· 291 291 ret = qcom_smem_get_soc_id(&msm_id); 292 292 if (ret == -ENODEV) { 293 293 const struct of_device_id *match; 294 - struct device_node *root; 295 - 296 - root = of_find_node_by_path("/"); 297 - if (!root) { 298 - ret = -ENODEV; 299 - goto exit; 300 - } 301 294 302 295 /* Fallback to compatible match with no SMEM initialized */ 303 - match = of_match_node(qcom_cpufreq_ipq806x_match_list, root); 304 - of_node_put(root); 296 + match = of_machine_get_match(qcom_cpufreq_ipq806x_match_list); 305 297 if (!match) { 306 298 ret = -ENODEV; 307 299 goto exit; ··· 639 647 */ 640 648 static int __init qcom_cpufreq_init(void) 641 649 { 642 - struct device_node *np __free(device_node) = of_find_node_by_path("/"); 643 650 const struct of_device_id *match; 644 651 int ret; 645 652 646 - if (!np) 647 - return -ENODEV; 648 - 649 - match = of_match_node(qcom_cpufreq_match_list, np); 653 + match = of_machine_get_match(qcom_cpufreq_match_list); 650 654 if (!match) 651 655 return -ENODEV; 652 656