diff options
Diffstat (limited to 'sys/dev/sume/if_sume.c')
-rw-r--r-- | sys/dev/sume/if_sume.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/sys/dev/sume/if_sume.c b/sys/dev/sume/if_sume.c index 8d6223cb54d1..7b2a27135e43 100644 --- a/sys/dev/sume/if_sume.c +++ b/sys/dev/sume/if_sume.c @@ -1143,7 +1143,7 @@ check_tx_queues(struct sume_adapter *adapter) } } -static int +static void sume_ifp_alloc(struct sume_adapter *adapter, uint32_t port) { if_t ifp; @@ -1151,11 +1151,6 @@ sume_ifp_alloc(struct sume_adapter *adapter, uint32_t port) M_ZERO | M_WAITOK); ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(adapter->dev, "cannot allocate ifnet\n"); - return (ENOMEM); - } - adapter->ifp[port] = ifp; if_setsoftc(ifp, nf_priv); @@ -1181,8 +1176,6 @@ sume_ifp_alloc(struct sume_adapter *adapter, uint32_t port) ifmedia_set(&nf_priv->media, IFM_ETHER | IFM_10G_SR); if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0); - - return (0); } static void @@ -1202,16 +1195,11 @@ sume_probe_riffa_buffer(const struct sume_adapter *adapter, { struct riffa_chnl_dir **rp; bus_addr_t hw_addr; - int error, ch; + int ch; device_t dev = adapter->dev; - error = ENOMEM; *p = malloc(SUME_RIFFA_CHANNELS * sizeof(struct riffa_chnl_dir *), M_SUME, M_ZERO | M_WAITOK); - if (*p == NULL) { - device_printf(dev, "malloc(%s) failed.\n", dir); - return (error); - } rp = *p; /* Allocate the chnl_dir structs themselves. */ @@ -1219,11 +1207,6 @@ sume_probe_riffa_buffer(const struct sume_adapter *adapter, /* One direction. */ rp[ch] = malloc(sizeof(struct riffa_chnl_dir), M_SUME, M_ZERO | M_WAITOK); - if (rp[ch] == NULL) { - device_printf(dev, "malloc(%s[%d]) riffa_chnl_dir " - "failed.\n", dir, ch); - return (error); - } int err = bus_dma_tag_create(bus_get_dma_tag(dev), 4, 0, @@ -1452,11 +1435,8 @@ sume_attach(device_t dev) goto error; /* Now do the network interfaces. */ - for (i = 0; i < SUME_NPORTS; i++) { - error = sume_ifp_alloc(adapter, i); - if (error != 0) - goto error; - } + for (i = 0; i < SUME_NPORTS; i++) + sume_ifp_alloc(adapter, i); /* Register stats and register sysctls. */ sume_sysctl_init(adapter); |