8d89cfcb8502dc273076c94ae8aadd4795388f03
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / microchip / lan966x / lan966x_vcap_impl.c
1 // SPDX-License-Identifier: GPL-2.0+
2
3 #include "lan966x_main.h"
4 #include "vcap_api.h"
5
6 int lan966x_vcap_init(struct lan966x *lan966x)
7 {
8         struct vcap_control *ctrl;
9
10         ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
11         if (!ctrl)
12                 return -ENOMEM;
13
14         lan966x->vcap_ctrl = ctrl;
15
16         return 0;
17 }
18
19 void lan966x_vcap_deinit(struct lan966x *lan966x)
20 {
21         struct vcap_control *ctrl;
22
23         ctrl = lan966x->vcap_ctrl;
24         if (!ctrl)
25                 return;
26
27         kfree(ctrl);
28 }