Don't need to copy the structure again, because cdev_register doesn't affect it. Made that clear by adding "const" in cdev_register's declaration.
This commit is contained in:
parent
4d2568c5db
commit
d4bc2dc1f5
|
@ -46,7 +46,7 @@ void cdev_init_system() {
|
|||
//
|
||||
// Register a channel device driver
|
||||
//
|
||||
short cdev_register(p_dev_chan device) {
|
||||
short cdev_register(const p_dev_chan device) {
|
||||
|
||||
TRACE1("cdev_register %s", device->name);
|
||||
short dev;
|
||||
|
@ -70,7 +70,7 @@ short cdev_register(p_dev_chan device) {
|
|||
cdev->seek = device->seek;
|
||||
cdev->flush = device->flush;
|
||||
cdev->ioctrl = device->ioctrl;
|
||||
return 0;
|
||||
return E_OK;
|
||||
} else {
|
||||
return DEV_ERR_BADDEV;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ extern void cdev_init_system();
|
|||
* Inputs:
|
||||
* p_dev_chan = pointer to the description of the channel device
|
||||
*/
|
||||
extern short cdev_register(p_dev_chan device);
|
||||
extern short cdev_register(const p_dev_chan device);
|
||||
|
||||
/*
|
||||
* Get a free channel
|
||||
|
|
Loading…
Reference in a new issue