mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 11:10:35 +08:00
Make it possible to create a cdev without automatically creating a device node.
This commit is contained in:
@@ -111,21 +111,21 @@ CDev::~CDev()
|
||||
int
|
||||
CDev::init()
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
// base class init first
|
||||
ret = Device::init();
|
||||
int ret = Device::init();
|
||||
|
||||
if (ret != OK)
|
||||
goto out;
|
||||
|
||||
// now register the driver
|
||||
ret = register_driver(_devname, &fops, 0666, (void *)this);
|
||||
if (_devname != nullptr) {
|
||||
ret = register_driver(_devname, &fops, 0666, (void *)this);
|
||||
|
||||
if (ret != OK)
|
||||
goto out;
|
||||
if (ret != OK)
|
||||
goto out;
|
||||
|
||||
_registered = true;
|
||||
_registered = true;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
@@ -395,4 +395,4 @@ cdev_poll(struct file *filp, struct pollfd *fds, bool setup)
|
||||
return cdev->poll(filp, fds, setup);
|
||||
}
|
||||
|
||||
} // namespace device
|
||||
} // namespace device
|
||||
|
||||
Reference in New Issue
Block a user