[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <df4caf97-d6b5-a8a8-250e-94dc41624c12@cogentembedded.com>
Date: Tue, 14 Mar 2017 14:17:27 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Alban <albeu@...e.fr>,
QCA ath9k Development <ath9k-devel@....qualcomm.com>
Cc: John Crispin <john@...ozen.org>, Kalle Valo <kvalo@...eaurora.org>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/7] ath9k: ahb: Add OF support
Hello!
On 3/14/2017 12:05 AM, Alban wrote:
> Allow registering ath9k AHB devices defined in DT. This just add the
> compatible strings to allow matching the driver and setting the proper
> device ID.
>
> Signed-off-by: Alban <albeu@...e.fr>
> ---
> drivers/net/wireless/ath/ath9k/ahb.c | 47 +++++++++++++++++++++++++++++++++---
> 1 file changed, 43 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
> index 2bd982c..36a2645 100644
> --- a/drivers/net/wireless/ath/ath9k/ahb.c
> +++ b/drivers/net/wireless/ath/ath9k/ahb.c
[...]
> @@ -79,10 +107,20 @@ static int ath_ahb_probe(struct platform_device *pdev)
> int ret = 0;
> struct ath_hw *ah;
> char hw_name[64];
> + u16 devid;
>
> - if (!dev_get_platdata(&pdev->dev)) {
> - dev_err(&pdev->dev, "no platform data specified\n");
> - return -EINVAL;
> + if (id) {
> + devid = id->driver_data;
> + } else {
> + const struct of_device_id *match;
> +
> + match = of_match_device(ath_ahb_of_match, &pdev->dev);
> + if (!match) {
> + dev_err(&pdev->dev, "no device match found\n");
> + return -EINVAL;
> + }
> +
> + devid = (u16)(unsigned long)match->data;
of_device_get_match_data() instead of the above perhaps?
[...]
MBR, Sergei
Powered by blists - more mailing lists