mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Alban <albeu@free.fr>,
	QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
Cc: John Crispin <john@phrozen.org>,
	Kalle Valo <kvalo@codeaurora.org>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] ath9k: ahb: Add OF support
Date: Tue, 14 Mar 2017 14:17:27 +0300	[thread overview]
Message-ID: <df4caf97-d6b5-a8a8-250e-94dc41624c12@cogentembedded.com> (raw)
In-Reply-To: <1489439116-4233-2-git-send-email-albeu@free.fr>

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@free.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

  reply	other threads:[~2017-03-14 11:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 21:05 [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Alban
2017-03-13 21:05 ` [PATCH 2/7] ath9k: ahb: Add OF support Alban
2017-03-14 11:17   ` Sergei Shtylyov [this message]
2017-03-13 21:05 ` [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Alban
2017-03-13 22:17   ` Rafał Miłecki
2017-03-13 23:53   ` Christian Lamparter
2017-03-23 14:43     ` Alban
2017-03-24 16:24       ` Christian Lamparter
2017-03-13 21:05 ` [PATCH 4/7] ath9k: Add support for reading the MAC address with nvmem Alban
2017-03-13 21:05 ` [PATCH 5/7] ath9k: of: Use the clk API to get the reference clock rate Alban
2017-03-13 22:17   ` Rafał Miłecki
2017-03-13 21:05 ` [PATCH 6/7] ath9k: Allow using the reset API for the external reset Alban
2017-03-13 21:05 ` [PATCH 7/7] ath9k: hw: Reset the device with the external reset before init Alban
2017-03-20 22:06 ` [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Rob Herring
2017-03-27 16:11 ` Christian Lamparter
2017-03-28  8:44   ` Alban
2017-03-28 14:53     ` Christian Lamparter
2017-03-28 15:18       ` Andrew Lunn
2017-03-28 16:21         ` Christian Lamparter
2017-03-28 16:41           ` Andrew Lunn
2017-03-28 17:09             ` Christian Lamparter
2017-04-05 10:09 ` 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=df4caf97-d6b5-a8a8-250e-94dc41624c12@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=albeu@free.fr \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=john@phrozen.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®