Commit fa43e99d authored by Stephen Boyd's avatar Stephen Boyd Committed by Kalle Valo

ath10k: Use device_get_match_data() to simplify code

Use device_get_match_data() here to simplify the code a bit.
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 79a4b788
...@@ -1466,7 +1466,6 @@ MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match); ...@@ -1466,7 +1466,6 @@ MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match);
static int ath10k_snoc_probe(struct platform_device *pdev) static int ath10k_snoc_probe(struct platform_device *pdev)
{ {
const struct ath10k_snoc_drv_priv *drv_data; const struct ath10k_snoc_drv_priv *drv_data;
const struct of_device_id *of_id;
struct ath10k_snoc *ar_snoc; struct ath10k_snoc *ar_snoc;
struct device *dev; struct device *dev;
struct ath10k *ar; struct ath10k *ar;
...@@ -1474,15 +1473,13 @@ static int ath10k_snoc_probe(struct platform_device *pdev) ...@@ -1474,15 +1473,13 @@ static int ath10k_snoc_probe(struct platform_device *pdev)
int ret; int ret;
u32 i; u32 i;
of_id = of_match_device(ath10k_snoc_dt_match, &pdev->dev); dev = &pdev->dev;
if (!of_id) { drv_data = device_get_match_data(dev);
dev_err(&pdev->dev, "failed to find matching device tree id\n"); if (!drv_data) {
dev_err(dev, "failed to find matching device tree id\n");
return -EINVAL; return -EINVAL;
} }
drv_data = of_id->data;
dev = &pdev->dev;
ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask); ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask);
if (ret) { if (ret) {
dev_err(dev, "failed to set dma mask: %d\n", ret); dev_err(dev, "failed to set dma mask: %d\n", ret);
......
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