From a9a31bc74568c9d6c0cb677d26ca0cdd0075ff64 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 29 Jan 2017 16:21:04 +0100 Subject: [PATCH] MPU6K: Device ID should come from the main instance, not interface --- src/drivers/mpu6000/mpu6000.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp index a9fcd11e31..474c6d0460 100644 --- a/src/drivers/mpu6000/mpu6000.cpp +++ b/src/drivers/mpu6000/mpu6000.cpp @@ -567,6 +567,9 @@ MPU6000::MPU6000(device::Device *interface, const char *path_accel, const char * break; } + // copy device type to interface + _interface->set_device_type(_device_id.devid_s.devtype); + // default accel scale factors _accel_scale.x_offset = 0; _accel_scale.x_scale = 1.0f; @@ -1523,9 +1526,6 @@ MPU6000::ioctl(struct file *filp, int cmd, unsigned long arg) case ACCELIOCGEXTERNAL: return _interface->ioctl(cmd, dummy); - case DEVIOCGDEVICEID: - return _interface->ioctl(cmd, dummy); - default: /* give it to the superclass */ return CDev::ioctl(filp, cmd, arg); @@ -1610,9 +1610,6 @@ MPU6000::gyro_ioctl(struct file *filp, int cmd, unsigned long arg) case GYROIOCGEXTERNAL: return _interface->ioctl(cmd, dummy); - case DEVIOCGDEVICEID: - return _interface->ioctl(cmd, dummy); - default: /* give it to the superclass */ return CDev::ioctl(filp, cmd, arg);