diff options
Diffstat (limited to 'drivers/net/dsa/ocelot/felix.c')
| -rw-r--r-- | drivers/net/dsa/ocelot/felix.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 5d34eb82e639..1587dd33a557 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -109,8 +109,7 @@ static int felix_tag_8021q_vlan_add_rx(struct dsa_switch *ds, int port, key_length = ocelot->vcap[VCAP_ES0].keys[VCAP_ES0_IGR_PORT].length; - outer_tagging_rule = kzalloc(sizeof(struct ocelot_vcap_filter), - GFP_KERNEL); + outer_tagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!outer_tagging_rule) return -ENOMEM; @@ -178,11 +177,11 @@ static int felix_tag_8021q_vlan_add_tx(struct dsa_switch *ds, int port, unsigned long cookie; int err; - untagging_rule = kzalloc(sizeof(struct ocelot_vcap_filter), GFP_KERNEL); + untagging_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!untagging_rule) return -ENOMEM; - redirect_rule = kzalloc(sizeof(struct ocelot_vcap_filter), GFP_KERNEL); + redirect_rule = kzalloc_obj(struct ocelot_vcap_filter, GFP_KERNEL); if (!redirect_rule) { kfree(untagging_rule); return -ENOMEM; @@ -1540,8 +1539,8 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) ocelot->npi_xtr_prefix = OCELOT_TAG_PREFIX_SHORT; ocelot->devlink = felix->ds->devlink; - port_phy_modes = kcalloc(num_phys_ports, sizeof(phy_interface_t), - GFP_KERNEL); + port_phy_modes = kzalloc_objs(phy_interface_t, num_phys_ports, + GFP_KERNEL); if (!port_phy_modes) return -ENOMEM; |
