myri10ge: check that we can get an irq

Now that IRQ allocation is done in myri10ge_open(), we want to still
check when loading the driver that IRQ allocation could succeed later.

Additionaly, we fix the initialization and printing of netdev->irq.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by Brice Goglin and committed by Jeff Garzik 21d05db1 6ebc087a

+12 -3
+12 -3
drivers/net/myri10ge/myri10ge.c
··· 2882 2882 netdev->hard_start_xmit = myri10ge_xmit; 2883 2883 netdev->get_stats = myri10ge_get_stats; 2884 2884 netdev->base_addr = mgp->iomem_base; 2885 - netdev->irq = pdev->irq; 2886 2885 netdev->change_mtu = myri10ge_change_mtu; 2887 2886 netdev->set_multicast_list = myri10ge_set_multicast_list; 2888 2887 netdev->set_mac_address = myri10ge_set_mac_address; ··· 2890 2891 netdev->features |= NETIF_F_HIGHDMA; 2891 2892 netdev->poll = myri10ge_poll; 2892 2893 netdev->weight = myri10ge_napi_weight; 2894 + 2895 + /* make sure we can get an irq, and that MSI can be 2896 + * setup (if available). Also ensure netdev->irq 2897 + * is set to correct value if MSI is enabled */ 2898 + status = myri10ge_request_irq(mgp); 2899 + if (status != 0) 2900 + goto abort_with_firmware; 2901 + netdev->irq = pdev->irq; 2902 + myri10ge_free_irq(mgp); 2893 2903 2894 2904 /* Save configuration space to be restored if the 2895 2905 * nic resets due to a parity error */ ··· 2915 2907 dev_err(&pdev->dev, "register_netdev failed: %d\n", status); 2916 2908 goto abort_with_state; 2917 2909 } 2918 - dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n", 2919 - pdev->irq, mgp->tx.boundary, mgp->fw_name, 2910 + dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2911 + (mgp->msi_enabled ? "MSI" : "xPIC"), 2912 + netdev->irq, mgp->tx.boundary, mgp->fw_name, 2920 2913 (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2921 2914 2922 2915 return 0;