aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/snoc.c
diff options
context:
space:
mode:
authorStephen Boyd <swboyd@chromium.org>2020-01-23 15:29:44 -0800
committerKalle Valo <kvalo@codeaurora.org>2020-01-26 16:30:20 +0200
commitfa43e99dd4b76201eb323ee3918c68132e8abba9 (patch)
tree0b9f0601bbc9cc2cffc13ec98b2264108c3dfe56 /drivers/net/wireless/ath/ath10k/snoc.c
parentath10k: Add newlines to printk messages (diff)
downloadlinux-dev-fa43e99dd4b76201eb323ee3918c68132e8abba9.tar.xz
linux-dev-fa43e99dd4b76201eb323ee3918c68132e8abba9.zip
ath10k: Use device_get_match_data() to simplify code
Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/snoc.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/snoc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c
index 2189a0d01f5a..21081b4a27d7 100644
--- a/drivers/net/wireless/ath/ath10k/snoc.c
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
@@ -1466,7 +1466,6 @@ MODULE_DEVICE_TABLE(of, ath10k_snoc_dt_match);
static int ath10k_snoc_probe(struct platform_device *pdev)
{
const struct ath10k_snoc_drv_priv *drv_data;
- const struct of_device_id *of_id;
struct ath10k_snoc *ar_snoc;
struct device *dev;
struct ath10k *ar;
@@ -1474,15 +1473,13 @@ static int ath10k_snoc_probe(struct platform_device *pdev)
int ret;
u32 i;
- of_id = of_match_device(ath10k_snoc_dt_match, &pdev->dev);
- if (!of_id) {
- dev_err(&pdev->dev, "failed to find matching device tree id\n");
+ dev = &pdev->dev;
+ drv_data = device_get_match_data(dev);
+ if (!drv_data) {
+ dev_err(dev, "failed to find matching device tree id\n");
return -EINVAL;
}
- drv_data = of_id->data;
- dev = &pdev->dev;
-
ret = dma_set_mask_and_coherent(dev, drv_data->dma_mask);
if (ret) {
dev_err(dev, "failed to set dma mask: %d\n", ret);