From: Francois Romieu <romieu@fr.zoreil.com>
To: Tony Prisk <linux@prisktech.co.nz>
Cc: vt8500-wm8505-linux-kernel@googlegroups.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, davem@davemloft.net,
netdev@vger.kernel.org
Subject: Re: [PATCHv3 3/3] net: velocity: Add platform device support to VIA velocity driver
Date: Tue, 30 Apr 2013 01:04:50 +0200 [thread overview]
Message-ID: <20130429230450.GA2620@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <1367264772-4557-4-git-send-email-linux@prisktech.co.nz>
Tony Prisk <linux@prisktech.co.nz> :
[...]
> +static int velocity_remove(void *pdev, enum velocity_bus_type bustype)
> +{
> + struct net_device *netdev;
> + struct velocity_info *vptr;
> + int pci = (bustype == BUS_PCI) ? 1 : 0;
> +
> + if (pci)
> + netdev = pci_get_drvdata(pdev);
> + else
> + netdev = platform_get_drvdata(pdev);
The caller knows how to retrieve the net_device pointer, whence
the struct velocity_info pointer, whence any bustype dependent
function pointer to alleviate the "if (pci)" and CONFIG stuff.
If you are not convinced, please consider turning the void *
into an union *.
--
Ueimor
next prev parent reply other threads:[~2013-04-29 23:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 19:46 [PATCHv3 0/3] Add support for velocity network driver on platform devices Tony Prisk
2013-04-29 19:46 ` [PATCHv3 1/3] net: velocity: Rename vptr->dev to vptr->netdev Tony Prisk
2013-04-29 19:46 ` [PATCHv3 2/3] net: velocity: Convert to generic dma functions Tony Prisk
2013-04-29 19:46 ` [PATCHv3 3/3] net: velocity: Add platform device support to VIA velocity driver Tony Prisk
2013-04-29 23:04 ` Francois Romieu [this message]
2013-05-02 17:19 ` Russell King - ARM Linux
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=20130429230450.GA2620@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=netdev@vger.kernel.org \
--cc=vt8500-wm8505-linux-kernel@googlegroups.com \
/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®