| .. | .. |
|---|
| 429 | 429 | struct niu_link_config *lp = &np->link_config; |
|---|
| 430 | 430 | u16 pll_cfg, pll_sts; |
|---|
| 431 | 431 | int max_retry = 100; |
|---|
| 432 | | - u64 uninitialized_var(sig), mask, val; |
|---|
| 432 | + u64 sig, mask, val; |
|---|
| 433 | 433 | u32 tx_cfg, rx_cfg; |
|---|
| 434 | 434 | unsigned long i; |
|---|
| 435 | 435 | int err; |
|---|
| .. | .. |
|---|
| 526 | 526 | struct niu_link_config *lp = &np->link_config; |
|---|
| 527 | 527 | u32 tx_cfg, rx_cfg, pll_cfg, pll_sts; |
|---|
| 528 | 528 | int max_retry = 100; |
|---|
| 529 | | - u64 uninitialized_var(sig), mask, val; |
|---|
| 529 | + u64 sig, mask, val; |
|---|
| 530 | 530 | unsigned long i; |
|---|
| 531 | 531 | int err; |
|---|
| 532 | 532 | |
|---|
| .. | .. |
|---|
| 714 | 714 | |
|---|
| 715 | 715 | static int esr_reset(struct niu *np) |
|---|
| 716 | 716 | { |
|---|
| 717 | | - u32 uninitialized_var(reset); |
|---|
| 717 | + u32 reset; |
|---|
| 718 | 718 | int err; |
|---|
| 719 | 719 | |
|---|
| 720 | 720 | err = mdio_write(np, np->port, NIU_ESR_DEV_ADDR, |
|---|
| .. | .. |
|---|
| 1216 | 1216 | current_duplex = DUPLEX_INVALID; |
|---|
| 1217 | 1217 | |
|---|
| 1218 | 1218 | spin_lock_irqsave(&np->lock, flags); |
|---|
| 1219 | | - |
|---|
| 1220 | | - err = -EINVAL; |
|---|
| 1221 | 1219 | |
|---|
| 1222 | 1220 | err = mii_read(np, np->phy_addr, MII_BMSR); |
|---|
| 1223 | 1221 | if (err < 0) |
|---|
| .. | .. |
|---|
| 6517 | 6515 | spin_unlock_irqrestore(&np->lock, flags); |
|---|
| 6518 | 6516 | } |
|---|
| 6519 | 6517 | |
|---|
| 6520 | | -static void niu_tx_timeout(struct net_device *dev) |
|---|
| 6518 | +static void niu_tx_timeout(struct net_device *dev, unsigned int txqueue) |
|---|
| 6521 | 6519 | { |
|---|
| 6522 | 6520 | struct niu *np = netdev_priv(dev); |
|---|
| 6523 | 6521 | |
|---|
| .. | .. |
|---|
| 6695 | 6693 | |
|---|
| 6696 | 6694 | len = skb_frag_size(frag); |
|---|
| 6697 | 6695 | mapping = np->ops->map_page(np->device, skb_frag_page(frag), |
|---|
| 6698 | | - frag->page_offset, len, |
|---|
| 6696 | + skb_frag_off(frag), len, |
|---|
| 6699 | 6697 | DMA_TO_DEVICE); |
|---|
| 6700 | 6698 | |
|---|
| 6701 | 6699 | rp->tx_buffs[prod].skb = NULL; |
|---|
| .. | .. |
|---|
| 7462 | 7460 | class = CLASS_CODE_USER_PROG4; |
|---|
| 7463 | 7461 | break; |
|---|
| 7464 | 7462 | default: |
|---|
| 7463 | + class = CLASS_CODE_UNRECOG; |
|---|
| 7465 | 7464 | break; |
|---|
| 7466 | 7465 | } |
|---|
| 7467 | 7466 | ret = tcam_user_ip_class_set(np, class, 0, |
|---|
| .. | .. |
|---|
| 8840 | 8839 | else |
|---|
| 8841 | 8840 | goto unknown_vg_1g_port; |
|---|
| 8842 | 8841 | |
|---|
| 8843 | | - /* fallthru */ |
|---|
| 8842 | + fallthrough; |
|---|
| 8844 | 8843 | case 0x22: |
|---|
| 8845 | 8844 | val = (phy_encode(PORT_TYPE_10G, 0) | |
|---|
| 8846 | 8845 | phy_encode(PORT_TYPE_10G, 1) | |
|---|
| .. | .. |
|---|
| 8865 | 8864 | else |
|---|
| 8866 | 8865 | goto unknown_vg_1g_port; |
|---|
| 8867 | 8866 | |
|---|
| 8868 | | - /* fallthru */ |
|---|
| 8867 | + fallthrough; |
|---|
| 8869 | 8868 | case 0x13: |
|---|
| 8870 | 8869 | if ((lowest_10g & 0x7) == 0) |
|---|
| 8871 | 8870 | val = (phy_encode(PORT_TYPE_10G, 0) | |
|---|
| .. | .. |
|---|
| 9881 | 9880 | } |
|---|
| 9882 | 9881 | } |
|---|
| 9883 | 9882 | |
|---|
| 9884 | | -static int niu_suspend(struct pci_dev *pdev, pm_message_t state) |
|---|
| 9883 | +static int __maybe_unused niu_suspend(struct device *dev_d) |
|---|
| 9885 | 9884 | { |
|---|
| 9886 | | - struct net_device *dev = pci_get_drvdata(pdev); |
|---|
| 9885 | + struct net_device *dev = dev_get_drvdata(dev_d); |
|---|
| 9887 | 9886 | struct niu *np = netdev_priv(dev); |
|---|
| 9888 | 9887 | unsigned long flags; |
|---|
| 9889 | 9888 | |
|---|
| .. | .. |
|---|
| 9905 | 9904 | niu_stop_hw(np); |
|---|
| 9906 | 9905 | spin_unlock_irqrestore(&np->lock, flags); |
|---|
| 9907 | 9906 | |
|---|
| 9908 | | - pci_save_state(pdev); |
|---|
| 9909 | | - |
|---|
| 9910 | 9907 | return 0; |
|---|
| 9911 | 9908 | } |
|---|
| 9912 | 9909 | |
|---|
| 9913 | | -static int niu_resume(struct pci_dev *pdev) |
|---|
| 9910 | +static int __maybe_unused niu_resume(struct device *dev_d) |
|---|
| 9914 | 9911 | { |
|---|
| 9915 | | - struct net_device *dev = pci_get_drvdata(pdev); |
|---|
| 9912 | + struct net_device *dev = dev_get_drvdata(dev_d); |
|---|
| 9916 | 9913 | struct niu *np = netdev_priv(dev); |
|---|
| 9917 | 9914 | unsigned long flags; |
|---|
| 9918 | 9915 | int err; |
|---|
| 9919 | 9916 | |
|---|
| 9920 | 9917 | if (!netif_running(dev)) |
|---|
| 9921 | 9918 | return 0; |
|---|
| 9922 | | - |
|---|
| 9923 | | - pci_restore_state(pdev); |
|---|
| 9924 | 9919 | |
|---|
| 9925 | 9920 | netif_device_attach(dev); |
|---|
| 9926 | 9921 | |
|---|
| .. | .. |
|---|
| 9938 | 9933 | return err; |
|---|
| 9939 | 9934 | } |
|---|
| 9940 | 9935 | |
|---|
| 9936 | +static SIMPLE_DEV_PM_OPS(niu_pm_ops, niu_suspend, niu_resume); |
|---|
| 9937 | + |
|---|
| 9941 | 9938 | static struct pci_driver niu_pci_driver = { |
|---|
| 9942 | 9939 | .name = DRV_MODULE_NAME, |
|---|
| 9943 | 9940 | .id_table = niu_pci_tbl, |
|---|
| 9944 | 9941 | .probe = niu_pci_init_one, |
|---|
| 9945 | 9942 | .remove = niu_pci_remove_one, |
|---|
| 9946 | | - .suspend = niu_suspend, |
|---|
| 9947 | | - .resume = niu_resume, |
|---|
| 9943 | + .driver.pm = &niu_pm_ops, |
|---|
| 9948 | 9944 | }; |
|---|
| 9949 | 9945 | |
|---|
| 9950 | 9946 | #ifdef CONFIG_SPARC64 |
|---|