linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Alexey Charkov <alchark@gmail.com>
Cc: netdev@vger.kernel.org, linux@prisktech.co.nz,
	devicetree@vger.kernel.org, rl@hellgate.ch,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] net: via-rhine: add OF bus binding
Date: Mon, 27 Jan 2014 14:57:34 +0000	[thread overview]
Message-ID: <1390834654.2735.148.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1390823503-24087-4-git-send-email-alchark@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On Mon, 2014-01-27 at 15:51 +0400, Alexey Charkov wrote:
> This should make the driver usable with VIA/WonderMedia ARM-based
> Systems-on-Chip integrated Rhine III adapters. Note that these
> are always in MMIO mode, and don't have any known EEPROM.
[...]
> --- a/drivers/net/ethernet/via/Kconfig
> +++ b/drivers/net/ethernet/via/Kconfig
> @@ -19,7 +19,7 @@ if NET_VENDOR_VIA
>  
>  config VIA_RHINE
>         tristate "VIA Rhine support"
> -       depends on PCI
> +       depends on (PCI || USE_OF)
>         select CRC32
>         select MII
>         ---help---

This seems like the right thing to do, but it means you need to add
#ifdef CONFIG_PCI and #ifdef CONFIG_USE_OF around the driver structures
and related functions.

You should compile-test in configurations that have just one of those
dependencies enabled.

[...]
> --- a/drivers/net/ethernet/via/via-rhine.c
> +++ b/drivers/net/ethernet/via/via-rhine.c
[...]
> @@ -847,7 +856,8 @@ static void rhine_hw_init(struct net_device *dev, long pioaddr)
>  		msleep(5);
>  
>  	/* Reload EEPROM controlled bytes cleared by soft reset */
> -	rhine_reload_eeprom(pioaddr, dev);
> +	if (!strncmp(dev->dev.parent->bus->name, "pci", 3))
> +		rhine_reload_eeprom(pioaddr, dev);
[...]

Ew.  I think you should use dev_is_pci(), although you might also need
to guard that with #ifdef CONFIG_PCI.

Ben.

-- 
Ben Hutchings
If at first you don't succeed, you're doing about average.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-01-27 14:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1385227995-3956-1-git-send-email-alchark@gmail.com>
2013-11-30 19:07 ` [PATCH 0/3] net: via-rhine: add support for on-chip Rhine controllers Alexey Charkov
2014-01-27 11:51 ` [PATCH 0/3] Resubmit: " Alexey Charkov
2014-01-27 11:51   ` [PATCH 1/3] net: via-rhine: switch to generic DMA functions Alexey Charkov
2014-01-27 14:49     ` Ben Hutchings
2014-01-27 15:26       ` Alexey Charkov
2014-01-27 15:28         ` Ben Hutchings
2014-01-27 11:51   ` [PATCH 2/3] net: via-rhine: reduce usage of the PCI-specific struct Alexey Charkov
2014-01-27 11:51   ` [PATCH 3/3] net: via-rhine: add OF bus binding Alexey Charkov
2014-01-27 14:57     ` Ben Hutchings [this message]
2014-01-27 15:34       ` Alexey Charkov
2014-01-27 23:40         ` Ben Hutchings
2014-01-28 18:31           ` Alexey Charkov
2014-01-31 14:24             ` Ben Hutchings
2014-01-27 15:56     ` Rob Herring
2014-01-28 18:27       ` Alexey Charkov
2014-01-29  3:44         ` Tony Prisk
2014-01-29  5:20           ` Alexey Charkov
2014-01-29 14:59             ` Rob Herring
2014-01-29 13:46         ` Rob Herring
2014-04-22 15:28   ` [PATCH v2 0/3] net: via-rhine: add support for on-chip Rhine controllers Alexey Charkov
2014-04-22 15:28     ` [PATCH 1/3] net: via-rhine: switch to generic DMA functions Alexey Charkov
2014-04-22 15:28     ` [PATCH 2/3] net: via-rhine: reduce usage of the PCI-specific struct Alexey Charkov
2014-04-22 15:28     ` [PATCH 3/3] net: via-rhine: add OF bus binding Alexey Charkov
2014-04-22 15:46       ` Rob Herring
2014-04-23 19:26     ` [PATCH v2 0/3] net: via-rhine: add support for on-chip Rhine controllers David Miller

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=1390834654.2735.148.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=alchark@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@prisktech.co.nz \
    --cc=netdev@vger.kernel.org \
    --cc=rl@hellgate.ch \
    /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;
as well as URLs for NNTP newsgroup(s).