From: Stephen Boyd <swboyd@chromium.org> To: Kalle Valo <kvalo@codeaurora.org> Cc: linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] ath10k: Use device_get_match_data() to simplify code Date: Thu, 23 Jan 2020 15:29:44 -0800 [thread overview] Message-ID: <20200123232944.39247-1-swboyd@chromium.org> (raw) Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- drivers/net/wireless/ath/ath10k/snoc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 19a4d053d1de..88900f0399f5 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,14 +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 = &pdev->dev; + drv_data = device_get_match_data(dev); + if (!drv_data) { dev_err(&pdev->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) { -- Sent by a computer, using git, on the internet
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <swboyd@chromium.org> To: Kalle Valo <kvalo@codeaurora.org> Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH] ath10k: Use device_get_match_data() to simplify code Date: Thu, 23 Jan 2020 15:29:44 -0800 [thread overview] Message-ID: <20200123232944.39247-1-swboyd@chromium.org> (raw) Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Stephen Boyd <swboyd@chromium.org> --- drivers/net/wireless/ath/ath10k/snoc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 19a4d053d1de..88900f0399f5 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,14 +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 = &pdev->dev; + drv_data = device_get_match_data(dev); + if (!drv_data) { dev_err(&pdev->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) { -- Sent by a computer, using git, on the internet _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k
next reply other threads:[~2020-01-23 23:29 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-01-23 23:29 Stephen Boyd [this message] 2020-01-23 23:29 ` [PATCH] ath10k: Use device_get_match_data() to simplify code Stephen Boyd 2020-01-26 4:18 ` Justin Capella 2020-01-26 4:18 ` Justin Capella 2020-01-26 14:25 ` Kalle Valo 2020-01-26 14:25 ` Kalle Valo 2020-01-26 14:34 ` Kalle Valo 2020-01-26 14:34 ` Kalle Valo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200123232944.39247-1-swboyd@chromium.org \ --to=swboyd@chromium.org \ --cc=ath10k@lists.infradead.org \ --cc=kvalo@codeaurora.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-wireless@vger.kernel.org \ --cc=netdev@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.