diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-10-21 11:24:51 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-10-21 11:24:51 +0200 |
commit | 28171fb5965c439b20571648039106e8839be4d8 (patch) | |
tree | 98702d5e3ff63791a2108b884e78da8c5279faa4 /apps/drivers | |
parent | f868c99f06d1d31e6c6626c1195bed550807ece3 (diff) | |
parent | 73521cbc66fa4fbc350c15cef277fabfce89c150 (diff) | |
download | px4-firmware-28171fb5965c439b20571648039106e8839be4d8.tar.gz px4-firmware-28171fb5965c439b20571648039106e8839be4d8.tar.bz2 px4-firmware-28171fb5965c439b20571648039106e8839be4d8.zip |
Merge branch 'master' of github.com:PX4/Firmware into calibration
Diffstat (limited to 'apps/drivers')
-rw-r--r-- | apps/drivers/device/cdev.cpp | 4 | ||||
-rw-r--r-- | apps/drivers/device/device.h | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/drivers/device/cdev.cpp b/apps/drivers/device/cdev.cpp index 6b8bf0c2d..d07d26e82 100644 --- a/apps/drivers/device/cdev.cpp +++ b/apps/drivers/device/cdev.cpp @@ -74,7 +74,7 @@ static int cdev_poll(struct file *filp, struct pollfd *fds, bool setup); * Note that we use the GNU extension syntax here because we don't get designated * initialisers in gcc 4.6. */ -static const struct file_operations cdev_fops = { +const struct file_operations CDev::fops = { open : cdev_open, close : cdev_close, read : cdev_read, @@ -118,7 +118,7 @@ CDev::init() goto out; // now register the driver - ret = register_driver(_devname, &cdev_fops, 0666, (void *)this); + ret = register_driver(_devname, &fops, 0666, (void *)this); if (ret != OK) goto out; diff --git a/apps/drivers/device/device.h b/apps/drivers/device/device.h index 98dbf8bfb..9af678465 100644 --- a/apps/drivers/device/device.h +++ b/apps/drivers/device/device.h @@ -287,6 +287,12 @@ public: protected: /** + * Pointer to the default cdev file operations table; useful for + * registering clone devices etc. + */ + static const struct file_operations fops; + + /** * Check the current state of the device for poll events from the * perspective of the file. * |