@@ -2411,10 +2411,17 @@ static int rhine_close(struct net_device *dev)
return 0;
}
+/* Cast-only helper (try to minimize type-unsafe void * assignments). */
+/* TODO: could be doing the same thing for netdev_priv() use. */
+static inline struct net_device *
+rhine_to_net_device(struct pci_dev *pdev)
+{
+ return pci_get_drvdata(pdev);
+}
static void rhine_remove_one(struct pci_dev *pdev)
{
- struct net_device *dev = pci_get_drvdata(pdev);
+ struct net_device *dev = rhine_to_net_device(pdev);
struct rhine_private *rp = netdev_priv(dev);
unregister_netdev(dev);
@@ -2430,7 +2437,7 @@ static void rhine_remove_one(struct pci_dev *pdev)
static void
rhine_shutdown_and_keep_wol(struct pci_dev *pdev)
{
- struct net_device *dev = pci_get_drvdata(pdev);
+ struct net_device *dev = rhine_to_net_device(pdev);
struct rhine_private *rp = netdev_priv(dev);
void __iomem *ioaddr = rp->base;
@@ -2489,7 +2496,7 @@ rhine_shutdown_and_keep_wol(struct pci_dev *pdev)
static int rhine_suspend(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
- struct net_device *dev = pci_get_drvdata(pdev);
+ struct net_device *dev = rhine_to_net_device(pdev);
struct rhine_private *rp = netdev_priv(dev);
if (!netif_running(dev))
@@ -2509,7 +2516,7 @@ static int rhine_suspend(struct device *device)
static int rhine_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
- struct net_device *dev = pci_get_drvdata(pdev);
+ struct net_device *dev = rhine_to_net_device(pdev);
struct rhine_private *rp = netdev_priv(dev);
/*