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

firmware: arm_scpi: Use device_get_match_data()

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006224650.445424-1-robh@kernel.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

authored by

Rob Herring and committed by
Sudeep Holla
908af696 0a81b0eb

+5 -8
+5 -8
drivers/firmware/arm_scpi.c
··· 26 26 #include <linux/list.h> 27 27 #include <linux/mailbox_client.h> 28 28 #include <linux/module.h> 29 + #include <linux/of.h> 29 30 #include <linux/of_address.h> 30 31 #include <linux/of_platform.h> 32 + #include <linux/platform_device.h> 31 33 #include <linux/printk.h> 34 + #include <linux/property.h> 32 35 #include <linux/pm_opp.h> 33 36 #include <linux/scpi_protocol.h> 34 37 #include <linux/slab.h> ··· 897 894 return 0; 898 895 } 899 896 900 - static const struct of_device_id legacy_scpi_of_match[] = { 901 - {.compatible = "arm,scpi-pre-1.0"}, 902 - {}, 903 - }; 904 - 905 897 static const struct of_device_id shmem_of_match[] __maybe_unused = { 906 898 { .compatible = "amlogic,meson-gxbb-scp-shmem", }, 907 899 { .compatible = "amlogic,meson-axg-scp-shmem", }, ··· 917 919 if (!scpi_drvinfo) 918 920 return -ENOMEM; 919 921 920 - if (of_match_device(legacy_scpi_of_match, &pdev->dev)) 921 - scpi_drvinfo->is_legacy = true; 922 + scpi_drvinfo->is_legacy = !!device_get_match_data(dev); 922 923 923 924 count = of_count_phandle_with_args(np, "mboxes", "#mbox-cells"); 924 925 if (count < 0) { ··· 1035 1038 1036 1039 static const struct of_device_id scpi_of_match[] = { 1037 1040 {.compatible = "arm,scpi"}, 1038 - {.compatible = "arm,scpi-pre-1.0"}, 1041 + {.compatible = "arm,scpi-pre-1.0", .data = (void *)1UL }, 1039 1042 {}, 1040 1043 }; 1041 1044