From ac4d7ee60e16c7e290ad0957a9204938281e0f39 Mon Sep 17 00:00:00 2001 From: Zorro Liu Date: Mon, 4 Jul 2016 14:16:53 +0800 Subject: [PATCH] driver, sensors: fix compile err Change-Id: Ice9e31086b29a20e37bf5ba3bf08d1e77a9a36a3 Signed-off-by: Zorro Liu --- drivers/input/sensors/compass/ak8963.c | 4 ---- drivers/input/sensors/compass/ak8975.c | 4 ---- drivers/input/sensors/gyro/ewtsa.c | 10 ++++++---- drivers/input/sensors/sensor-dev.c | 8 -------- drivers/input/sensors/sensor-i2c.c | 5 ----- 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/drivers/input/sensors/compass/ak8963.c b/drivers/input/sensors/compass/ak8963.c index 305f9385deeb..d44fcb9c942f 100644 --- a/drivers/input/sensors/compass/ak8963.c +++ b/drivers/input/sensors/compass/ak8963.c @@ -340,8 +340,6 @@ static void compass_set_YPR(int *rbuf) static int compass_dev_open(struct inode *inode, struct file *file) { - struct sensor_private_data* sensor = - (struct sensor_private_data *)i2c_get_clientdata(this_client); int result = 0; DBG("%s\n",__func__); @@ -351,8 +349,6 @@ static int compass_dev_open(struct inode *inode, struct file *file) static int compass_dev_release(struct inode *inode, struct file *file) { - struct sensor_private_data* sensor = - (struct sensor_private_data *)i2c_get_clientdata(this_client); int result = 0; DBG("%s\n",__func__); diff --git a/drivers/input/sensors/compass/ak8975.c b/drivers/input/sensors/compass/ak8975.c index 3d372cb7230e..62e38911cd9b 100755 --- a/drivers/input/sensors/compass/ak8975.c +++ b/drivers/input/sensors/compass/ak8975.c @@ -312,8 +312,6 @@ static void compass_set_YPR(short *rbuf) static int compass_dev_open(struct inode *inode, struct file *file) { - struct sensor_private_data* sensor = - (struct sensor_private_data *)i2c_get_clientdata(this_client); int result = 0; DBG("%s\n",__func__); @@ -323,8 +321,6 @@ static int compass_dev_open(struct inode *inode, struct file *file) static int compass_dev_release(struct inode *inode, struct file *file) { - struct sensor_private_data* sensor = - (struct sensor_private_data *)i2c_get_clientdata(this_client); int result = 0; DBG("%s\n",__func__); diff --git a/drivers/input/sensors/gyro/ewtsa.c b/drivers/input/sensors/gyro/ewtsa.c index 436a3710755a..78684d6ea678 100755 --- a/drivers/input/sensors/gyro/ewtsa.c +++ b/drivers/input/sensors/gyro/ewtsa.c @@ -293,11 +293,12 @@ void gyro_dev_reset(struct i2c_client *client) static int sensor_active(struct i2c_client *client, int enable, int rate) { + /* struct sensor_private_data *sensor = (struct sensor_private_data *) i2c_get_clientdata(client); - int result = 0; int status = 0; - //register setting according to chip datasheet + */ + int result = 0; if(enable) { result=ewtsa_enable(client); @@ -319,11 +320,12 @@ static int sensor_init(struct i2c_client *client) struct sensor_private_data *sensor = (struct sensor_private_data *) i2c_get_clientdata(client); int result = 0; + /* unsigned char buf[5]; unsigned char data = 0; int i = 0; char pReadData=0; - + */ sensor->status_cur = SENSOR_OFF; gyro_dev_reset(client); ewtsa_system_restart(client); @@ -356,7 +358,7 @@ static int sensor_report_value(struct i2c_client *client) struct sensor_axis axis; char buffer[6] = {0}; int i = 0; - int value = 0; + /* int value = 0; */ memset(buffer, 0, 6); #if 0 diff --git a/drivers/input/sensors/sensor-dev.c b/drivers/input/sensors/sensor-dev.c index d7536fc421f7..1c4a0208b2e2 100755 --- a/drivers/input/sensors/sensor-dev.c +++ b/drivers/input/sensors/sensor-dev.c @@ -460,7 +460,6 @@ static long angle_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } sensor->status_cur = SENSOR_ON; @@ -608,7 +607,6 @@ static long gsensor_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } sensor->status_cur = SENSOR_ON; @@ -940,7 +938,6 @@ static long gyro_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } sensor->status_cur = SENSOR_ON; @@ -995,7 +992,6 @@ static long gyro_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } sensor->status_cur = SENSOR_ON; @@ -1076,7 +1072,6 @@ static long light_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } @@ -1177,7 +1172,6 @@ static long proximity_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } @@ -1277,7 +1271,6 @@ static long temperature_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } @@ -1380,7 +1373,6 @@ static long pressure_dev_ioctl(struct file *file, } else { - PREPARE_DELAYED_WORK(&sensor->delaywork, sensor_delaywork_func); schedule_delayed_work(&sensor->delaywork, msecs_to_jiffies(sensor->pdata->poll_delay_ms)); } diff --git a/drivers/input/sensors/sensor-i2c.c b/drivers/input/sensors/sensor-i2c.c index 7a36954cd24d..f54835096e88 100755 --- a/drivers/input/sensors/sensor-i2c.c +++ b/drivers/input/sensors/sensor-i2c.c @@ -50,7 +50,6 @@ static int sensor_i2c_write(struct i2c_adapter *i2c_adap, msgs[0].flags = 0; /* write */ msgs[0].buf = (unsigned char *)data; msgs[0].len = len; - msgs[0].scl_rate = SENSOR_I2C_RATE; res = i2c_transfer(i2c_adap, msgs, 1); if (res == 1) @@ -78,13 +77,11 @@ static int senosr_i2c_read(struct i2c_adapter *i2c_adap, msgs[0].flags = 0; /* write */ msgs[0].buf = ® msgs[0].len = 1; - msgs[0].scl_rate = SENSOR_I2C_RATE; msgs[1].addr = address; msgs[1].flags = I2C_M_RD; msgs[1].buf = data; msgs[1].len = len; - msgs[1].scl_rate = SENSOR_I2C_RATE; res = i2c_transfer(i2c_adap, msgs, 2); if (res == 2) @@ -174,7 +171,6 @@ static int i2c_master_normal_recv(const struct i2c_client *client, char *buf, in msg.flags = client->flags | I2C_M_RD; msg.len = count; msg.buf = (char *)buf; - msg.scl_rate = scl_rate; ret = i2c_transfer(adap, &msg, 1); return (ret == 1) ? count : ret; @@ -190,7 +186,6 @@ static int i2c_master_normal_send(const struct i2c_client *client, const char *b msg.flags = client->flags; msg.len = count; msg.buf = (char *)buf; - msg.scl_rate = scl_rate; ret = i2c_transfer(adap, &msg, 1); return (ret == 1) ? count : ret; -- 2.34.1