MCPcopy Create free account
hub / github.com/F-Stack/f-stack / smapi_probe

Function smapi_probe

freebsd/i386/bios/smapi.c:176–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176static int
177smapi_probe (device_t dev)
178{
179 struct resource *res;
180 int rid;
181 int error;
182
183 error = 0;
184 rid = 0;
185 res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE);
186 if (res == NULL) {
187 device_printf(dev, "Unable to allocate memory resource.\n");
188 error = ENOMEM;
189 goto bad;
190 }
191
192 if (smapi_header_cksum(RES2HDR(res))) {
193 device_printf(dev, "SMAPI header checksum failed.\n");
194 error = ENXIO;
195 goto bad;
196 }
197
198bad:
199 if (res)
200 bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
201 return (error);
202}
203
204static int
205smapi_attach (device_t dev)

Callers

nothing calls this directly

Calls 4

bus_alloc_resource_anyFunction · 0.85
device_printfFunction · 0.85
smapi_header_cksumFunction · 0.85
bus_release_resourceFunction · 0.85

Tested by

no test coverage detected