MCPcopy Create free account
hub / github.com/acidanthera/VoodooInput / start

Method start

VoodooInput/VoodooInput.cpp:21–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19OSDefineMetaClassAndStructors(VoodooInput, IOService);
20
21bool VoodooInput::start(IOService *provider) {
22 if (!super::start(provider)) {
23 IOLog("Kishor VoodooInput could not super::start!\n");
24 return false;
25 }
26
27 parentProvider = provider;
28
29 if (!updateProperties()) {
30 IOLog("VoodooInput could not get provider properties!\n");
31 return false;
32 }
33
34 // Allocate the simulator and actuator devices
35 simulator = OSTypeAlloc(VoodooInputSimulatorDevice);
36 actuator = OSTypeAlloc(VoodooInputActuatorDevice);
37 trackpoint = OSTypeAlloc(TrackpointDevice);
38
39 if (!simulator || !actuator || !trackpoint) {
40 IOLog("VoodooInput could not alloc simulator, actuator or trackpoint!\n");
41 OSSafeReleaseNULL(simulator);
42 OSSafeReleaseNULL(actuator);
43 OSSafeReleaseNULL(trackpoint);
44 return false;
45 }
46
47 // Initialize simulator device
48 if (!simulator->init(NULL) || !simulator->attach(this)) {
49 IOLog("VoodooInput could not attach simulator!\n");
50 goto exit;
51 }
52 else if (!simulator->start(this)) {
53 IOLog("VoodooInput could not start simulator!\n");
54 simulator->detach(this);
55 goto exit;
56 }
57
58 // Initialize actuator device
59 if (!actuator->init(NULL) || !actuator->attach(this)) {
60 IOLog("VoodooInput could not init or attach actuator!\n");
61 goto exit;
62 }
63 else if (!actuator->start(this)) {
64 IOLog("VoodooInput could not start actuator!\n");
65 actuator->detach(this);
66 goto exit;
67 }
68
69 // Initialize trackpoint device
70 if (!trackpoint->init(NULL) || !trackpoint->attach(this)) {
71 IOLog("VoodooInput could not init or attach trackpoint!\n");
72 goto exit;
73 }
74 else if (!trackpoint->start(this)) {
75 IOLog("VoodooInput could not start trackpoint!\n");
76 trackpoint->detach(this);
77 goto exit;
78 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected