static int ks8851_probe(struct spi_device *spi)
{
struct device *dev = &spi->dev;
- struct net_device *ndev;
+ struct net_device *netdev;
struct ks8851_net *ks;
int ret;
unsigned cider;
int gpio;
- ndev = alloc_etherdev(sizeof(struct ks8851_net));
- if (!ndev)
+ netdev = alloc_etherdev(sizeof(struct ks8851_net));
+ if (!netdev)
return -ENOMEM;
spi->bits_per_word = 8;
- ks = netdev_priv(ndev);
+ ks = netdev_priv(netdev);
- ks->netdev = ndev;
+ ks->netdev = netdev;
ks->spidev = spi;
ks->tx_space = 6144;
ks->eeprom.register_write = ks8851_eeprom_regwrite;
/* setup mii state */
- ks->mii.dev = ndev;
+ ks->mii.dev = netdev;
ks->mii.phy_id = 1,
ks->mii.phy_id_mask = 1;
ks->mii.reg_num_mask = 0xf;
skb_queue_head_init(&ks->txq);
- ndev->ethtool_ops = &ks8851_ethtool_ops;
- SET_NETDEV_DEV(ndev, dev);
+ netdev->ethtool_ops = &ks8851_ethtool_ops;
+ SET_NETDEV_DEV(netdev, dev);
spi_set_drvdata(spi, ks);
netif_carrier_off(ks->netdev);
- ndev->if_port = IF_PORT_100BASET;
- ndev->netdev_ops = &ks8851_netdev_ops;
- ndev->irq = spi->irq;
+ netdev->if_port = IF_PORT_100BASET;
+ netdev->netdev_ops = &ks8851_netdev_ops;
+ netdev->irq = spi->irq;
/* issue a global soft reset to reset the device. */
ks8851_soft_reset(ks, GRR_GSR);
ks8851_read_selftest(ks);
ks8851_init_mac(ks);
- ret = register_netdev(ndev);
+ ret = register_netdev(netdev);
if (ret) {
dev_err(dev, "failed to register network device\n");
goto err_netdev;
}
- netdev_info(ndev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n",
- CIDER_REV_GET(cider), ndev->dev_addr, ndev->irq,
+ netdev_info(netdev, "revision %d, MAC %pM, IRQ %d, %s EEPROM\n",
+ CIDER_REV_GET(cider), netdev->dev_addr, netdev->irq,
ks->rc_ccr & CCR_EEPROM ? "has" : "no");
return 0;
regulator_disable(ks->vdd_io);
err_reg_io:
err_gpio:
- free_netdev(ndev);
+ free_netdev(netdev);
return ret;
}