From d76155107cd381c909256ed36fa4330878be44d2 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Nov 2018 15:42:19 -0400 Subject: [PATCH] delete unused IOCTL MAGIOCGRANGE --- src/drivers/drv_mag.h | 3 --- src/drivers/imu/adis16448/adis16448.cpp | 3 --- src/drivers/magnetometer/hmc5883/hmc5883.cpp | 3 --- src/drivers/magnetometer/lis3mdl/lis3mdl.cpp | 3 --- src/drivers/magnetometer/rm3100/rm3100.cpp | 4 ---- src/modules/simulator/accelsim/accelsim.cpp | 3 --- src/modules/uavcan/sensors/mag.cpp | 1 - src/systemcmds/config/config.c | 5 ++--- 8 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/drivers/drv_mag.h b/src/drivers/drv_mag.h index fb589bc345..7510e0f8d2 100644 --- a/src/drivers/drv_mag.h +++ b/src/drivers/drv_mag.h @@ -78,9 +78,6 @@ struct mag_calibration_s { /** set the measurement range to handle (at least) arg Gauss */ #define MAGIOCSRANGE _MAGIOC(6) -/** return the current mag measurement range in Gauss */ -#define MAGIOCGRANGE _MAGIOC(7) - /** perform self-calibration, update scale factors to canonical units */ #define MAGIOCCALIBRATE _MAGIOC(8) diff --git a/src/drivers/imu/adis16448/adis16448.cpp b/src/drivers/imu/adis16448/adis16448.cpp index f0e3eadf3e..d296521067 100644 --- a/src/drivers/imu/adis16448/adis16448.cpp +++ b/src/drivers/imu/adis16448/adis16448.cpp @@ -1167,9 +1167,6 @@ ADIS16448::mag_ioctl(struct file *filp, int cmd, unsigned long arg) memcpy((struct mag_calibration_s *) arg, &_mag_scale, sizeof(_mag_scale)); return OK; - case MAGIOCGRANGE: - return (unsigned long)(_mag_range_mgauss); - default: /* give it to the superclass */ return SPI::ioctl(filp, cmd, arg); diff --git a/src/drivers/magnetometer/hmc5883/hmc5883.cpp b/src/drivers/magnetometer/hmc5883/hmc5883.cpp index 49c262618c..dfc019211f 100644 --- a/src/drivers/magnetometer/hmc5883/hmc5883.cpp +++ b/src/drivers/magnetometer/hmc5883/hmc5883.cpp @@ -700,9 +700,6 @@ HMC5883::ioctl(struct file *filp, int cmd, unsigned long arg) case MAGIOCSRANGE: return set_range(arg); - case MAGIOCGRANGE: - return _range_ga; - case MAGIOCSSCALE: /* set new scale factors */ memcpy(&_scale, (struct mag_calibration_s *)arg, sizeof(_scale)); diff --git a/src/drivers/magnetometer/lis3mdl/lis3mdl.cpp b/src/drivers/magnetometer/lis3mdl/lis3mdl.cpp index 203e76726b..8e696c590e 100644 --- a/src/drivers/magnetometer/lis3mdl/lis3mdl.cpp +++ b/src/drivers/magnetometer/lis3mdl/lis3mdl.cpp @@ -587,9 +587,6 @@ LIS3MDL::ioctl(struct file *file_pointer, int cmd, unsigned long arg) case MAGIOCSRANGE: return set_range(arg); - case MAGIOCGRANGE: - return _range_ga; - case MAGIOCSSCALE: /* set new scale factors */ memcpy(&_scale, (struct mag_calibration_s *)arg, sizeof(_scale)); diff --git a/src/drivers/magnetometer/rm3100/rm3100.cpp b/src/drivers/magnetometer/rm3100/rm3100.cpp index 5cf93a9f0d..1ff9d5e802 100644 --- a/src/drivers/magnetometer/rm3100/rm3100.cpp +++ b/src/drivers/magnetometer/rm3100/rm3100.cpp @@ -449,10 +449,6 @@ RM3100::ioctl(struct file *file_pointer, int cmd, unsigned long arg) /* field measurement range cannot be configured for this sensor (8 Gauss) */ return OK; - case MAGIOCGRANGE: - /* field measurement range cannot be configured for this sensor (8 Gauss) */ - return 8; - case MAGIOCSSCALE: /* set new scale factors */ memcpy(&_scale, (struct mag_calibration_s *)arg, sizeof(_scale)); diff --git a/src/modules/simulator/accelsim/accelsim.cpp b/src/modules/simulator/accelsim/accelsim.cpp index df39a7dd57..0b039c116a 100644 --- a/src/modules/simulator/accelsim/accelsim.cpp +++ b/src/modules/simulator/accelsim/accelsim.cpp @@ -672,9 +672,6 @@ ACCELSIM::mag_ioctl(unsigned long cmd, unsigned long arg) case MAGIOCSRANGE: return mag_set_range(arg); - case MAGIOCGRANGE: - return _mag_range_ga; - case MAGIOCGEXTERNAL: /* Even if this sensor is on the "external" SPI bus * it is still fixed to the autopilot assembly, diff --git a/src/modules/uavcan/sensors/mag.cpp b/src/modules/uavcan/sensors/mag.cpp index 430a4af44c..7bfd9f5e1a 100644 --- a/src/modules/uavcan/sensors/mag.cpp +++ b/src/modules/uavcan/sensors/mag.cpp @@ -120,7 +120,6 @@ int UavcanMagnetometerBridge::ioctl(struct file *filp, int cmd, unsigned long ar case MAGIOCCALIBRATE: case MAGIOCSRANGE: - case MAGIOCGRANGE: case MAGIOCEXSTRAP: { return -EINVAL; } diff --git a/src/systemcmds/config/config.c b/src/systemcmds/config/config.c index 5d4c2064e5..bdf2dda029 100644 --- a/src/systemcmds/config/config.c +++ b/src/systemcmds/config/config.c @@ -249,14 +249,13 @@ do_mag(int argc, char *argv[]) } int prate = ioctl(fd, SENSORIOCGPOLLRATE, 0); - int range = ioctl(fd, MAGIOCGRANGE, 0); int id = ioctl(fd, DEVIOCGDEVICEID, 0); int32_t calibration_id = 0; param_get(param_find("CAL_MAG0_ID"), &(calibration_id)); - PX4_INFO("mag: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tread rate:\t%d Hz\n\trange:\t%d Ga", - id, calibration_id, prate, range); + PX4_INFO("mag: \n\tdevice id:\t0x%X\t(calibration is for device id 0x%X)\n\tread rate:\t%d Hz", + id, calibration_id, prate); close(fd); }