Changeset 1055 for Whitix/branches/keobject/devices/kedev/device.c
- Timestamp:
- 10/03/08 12:11:36 (3 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/keobject/devices/kedev/device.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/devices/kedev/device.c
r978 r1055 17 17 */ 18 18 19 #include <device.h> 19 #include <devices/device.h> 20 #include <fs/devfs.h> 20 21 #include <keobject.h> 22 #include <module.h> 21 23 22 24 /* Set up the structure. */ 23 int KeDeviceInit(struct KeDevice* device, struct KeSet* type, DevId devId, void* devPriv) 25 int KeDeviceInit(struct KeDevice* device, struct KeSet* type, DevId devId, 26 void* devPriv, int devType) 24 27 { 25 28 KeObjectInit(&device->object, type); … … 27 30 device->devId = devId; 28 31 device->devPriv = devPriv; 32 device->type = devType; 29 33 30 34 return 0; 31 35 } 32 36 37 SYMBOL_EXPORT(KeDeviceInit); 38 39 int KeDeviceVaAttach(struct KeDevice* device, const char* name, VaList args) 40 { 41 int err; 42 43 err = KeObjectVaAttach(&device->object, name, args); 44 45 if (err) 46 return err; 47 48 /* Now add the device in the device filesystem. */ 49 return DevFsAddDevice(device, KeObjGetName(&device->object)); 50 } 51 52 SYMBOL_EXPORT(KeDeviceVaAttach); 53 33 54 int KeDeviceAttach(struct KeDevice* device, const char* name, ...) 34 55 { 35 56 int err; 57 VaList args; 36 58 37 59 /* Bind the KeObject to the filesystem first. This creates a directory … … 39 61 */ 40 62 41 err = KeObjectAttach(&device->object, name);63 VaStart(args, name); 42 64 43 if (err)44 return err;45 46 /* Now add the device in the device filesystem. */47 return DevFsAddDevice(device, name);65 err = KeDeviceVaAttach(device, name, args); 66 67 VaEnd(args); 68 69 return err; 48 70 } 71 72 SYMBOL_EXPORT(KeDeviceAttach);