This source file includes following definitions.
- nvkm_bus_intr
- nvkm_bus_init
- nvkm_bus_dtor
- nvkm_bus_new_
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include "priv.h"
25
26 static void
27 nvkm_bus_intr(struct nvkm_subdev *subdev)
28 {
29 struct nvkm_bus *bus = nvkm_bus(subdev);
30 bus->func->intr(bus);
31 }
32
33 static int
34 nvkm_bus_init(struct nvkm_subdev *subdev)
35 {
36 struct nvkm_bus *bus = nvkm_bus(subdev);
37 bus->func->init(bus);
38 return 0;
39 }
40
41 static void *
42 nvkm_bus_dtor(struct nvkm_subdev *subdev)
43 {
44 return nvkm_bus(subdev);
45 }
46
47 static const struct nvkm_subdev_func
48 nvkm_bus = {
49 .dtor = nvkm_bus_dtor,
50 .init = nvkm_bus_init,
51 .intr = nvkm_bus_intr,
52 };
53
54 int
55 nvkm_bus_new_(const struct nvkm_bus_func *func, struct nvkm_device *device,
56 int index, struct nvkm_bus **pbus)
57 {
58 struct nvkm_bus *bus;
59 if (!(bus = *pbus = kzalloc(sizeof(*bus), GFP_KERNEL)))
60 return -ENOMEM;
61 nvkm_subdev_ctor(&nvkm_bus, device, index, &bus->subdev);
62 bus->func = func;
63 return 0;
64 }