Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1600231
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/7] ath9k: ahb: Add OF support |
| Date | 2017-03-14 12:20 +0100 |
| Message-ID | <tkSEF-7LJ-15@gated-at.bofh.it> (permalink) |
| References | <tkFo6-6nZ-5@gated-at.bofh.it> <tkFo7-6nZ-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Alban <albeu@free.fr> - 2017-03-13 22:10 +0100
[PATCH 5/7] ath9k: of: Use the clk API to get the reference clock rate Alban <albeu@free.fr> - 2017-03-13 22:10 +0100
Re: [PATCH 5/7] ath9k: of: Use the clk API to get the reference clock rate Rafał Miłecki <zajec5@gmail.com> - 2017-03-13 23:20 +0100
[PATCH 2/7] ath9k: ahb: Add OF support Alban <albeu@free.fr> - 2017-03-13 22:10 +0100
Re: [PATCH 2/7] ath9k: ahb: Add OF support Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-03-14 12:20 +0100
[PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Alban <albeu@free.fr> - 2017-03-13 22:10 +0100
Re: [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Rafał Miłecki <zajec5@gmail.com> - 2017-03-13 23:20 +0100
Re: [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Christian Lamparter <chunkeey@googlemail.com> - 2017-03-14 01:00 +0100
Re: [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Alban <albeu@free.fr> - 2017-03-23 15:50 +0100
Re: [PATCH 3/7] ath9k: Add support for reading the EEPROM data using the nvmem API Christian Lamparter <chunkeey@googlemail.com> - 2017-03-24 17:30 +0100
[PATCH 4/7] ath9k: Add support for reading the MAC address with nvmem Alban <albeu@free.fr> - 2017-03-13 22:10 +0100
Re: [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Rob Herring <robh@kernel.org> - 2017-03-20 23:10 +0100
Re: [PATCH 1/7] Documentation: dt: net: Update the ath9k binding for SoC devices Christian Lamparter <chunkeey@googlemail.com> - 2017-03-27 18:20 +0200
csiph-web