Commit c4e9705c authored by Meng Tang's avatar Meng Tang Committed by Kalle Valo

ath10k: Use of_device_get_match_data() helper

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of of_match_device().
Signed-off-by: default avatarMeng Tang <tangmeng@uniontech.com>
Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220318025331.23030-1-tangmeng@uniontech.com
parent 2c3fc505
...@@ -728,20 +728,17 @@ static int ath10k_ahb_probe(struct platform_device *pdev) ...@@ -728,20 +728,17 @@ static int ath10k_ahb_probe(struct platform_device *pdev)
struct ath10k *ar; struct ath10k *ar;
struct ath10k_ahb *ar_ahb; struct ath10k_ahb *ar_ahb;
struct ath10k_pci *ar_pci; struct ath10k_pci *ar_pci;
const struct of_device_id *of_id;
enum ath10k_hw_rev hw_rev; enum ath10k_hw_rev hw_rev;
size_t size; size_t size;
int ret; int ret;
struct ath10k_bus_params bus_params = {}; struct ath10k_bus_params bus_params = {};
of_id = of_match_device(ath10k_ahb_of_match, &pdev->dev); hw_rev = (enum ath10k_hw_rev)of_device_get_match_data(&pdev->dev);
if (!of_id) { if (!hw_rev) {
dev_err(&pdev->dev, "failed to find matching device tree id\n"); dev_err(&pdev->dev, "OF data missing\n");
return -EINVAL; return -EINVAL;
} }
hw_rev = (enum ath10k_hw_rev)of_id->data;
size = sizeof(*ar_pci) + sizeof(*ar_ahb); size = sizeof(*ar_pci) + sizeof(*ar_ahb);
ar = ath10k_core_create(size, &pdev->dev, ATH10K_BUS_AHB, ar = ath10k_core_create(size, &pdev->dev, ATH10K_BUS_AHB,
hw_rev, &ath10k_ahb_hif_ops); hw_rev, &ath10k_ahb_hif_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment