lkml.org 
[lkml]   [2013]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 3/3] net: velocity: Add platform device support to VIA velocity driver
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


\
 
 \ /
  Last update: 2013-04-30 01:21    [W:0.055 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site