From: ywj Date: Thu, 26 Jun 2014 02:59:32 +0000 (+0800) Subject: fix some warning for mpu6050 X-Git-Tag: firefly_0821_release~5045 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=39e5cf1b68f8e6b203d13e7b0dccf4250d7fc6cc;p=firefly-linux-kernel-4.4.55.git fix some warning for mpu6050 --- diff --git a/drivers/misc/inv_mpu/accel/mpu6050.c b/drivers/misc/inv_mpu/accel/mpu6050.c index efb6627f50e3..1020632467c8 100755 --- a/drivers/misc/inv_mpu/accel/mpu6050.c +++ b/drivers/misc/inv_mpu/accel/mpu6050.c @@ -253,8 +253,6 @@ static int mpu6050_set_irq(void *mlsl_handle, struct mpu6050_config *config, long apply, long irq_type) { - int result; - unsigned char reg_int_cfg; /* HACK, no need for interrupts for MPU6050 accel - use of soft interrupt is required */ diff --git a/drivers/misc/inv_mpu/compass/ak8963.c b/drivers/misc/inv_mpu/compass/ak8963.c index ced3789b6d25..bba661110ecd 100755 --- a/drivers/misc/inv_mpu/compass/ak8963.c +++ b/drivers/misc/inv_mpu/compass/ak8963.c @@ -83,7 +83,6 @@ static int ak8963_init(void *mlsl_handle, { int result; unsigned char serial_data[COMPASS_NUM_AXES]; - printk("yemk:ak8963_init\n"); struct ak8963_private_data *private_data; private_data = (struct ak8963_private_data *) kzalloc(sizeof(struct ak8963_private_data), GFP_KERNEL); diff --git a/drivers/misc/inv_mpu/mldl_cfg.c b/drivers/misc/inv_mpu/mldl_cfg.c index e49305cb0586..759f79227fd5 100755 --- a/drivers/misc/inv_mpu/mldl_cfg.c +++ b/drivers/misc/inv_mpu/mldl_cfg.c @@ -465,7 +465,7 @@ static int inv_get_silicon_rev_mpu6050( } else { MPL_LOGE("Software revision key is outside of known " - "range [0..%d] : %d\n", ARRAY_SIZE(sw_rev_map)); + "range [0..%d] : %d\n", ARRAY_SIZE(sw_rev_map),ARRAY_SIZE(sw_rev_map)); return INV_ERROR_INVALID_MODULE; } diff --git a/drivers/misc/inv_mpu/mpu-dev.c b/drivers/misc/inv_mpu/mpu-dev.c index db440a6253a5..b6dd66ee79bd 100755 --- a/drivers/misc/inv_mpu/mpu-dev.c +++ b/drivers/misc/inv_mpu/mpu-dev.c @@ -464,7 +464,7 @@ static int slave_config(struct mldl_cfg *mldl_cfg, return -EFAULT; if (config.len && config.data) { - void *data; + void *data=NULL; data = kmalloc(config.len, GFP_KERNEL); if (!data) return -ENOMEM; @@ -556,9 +556,9 @@ static void mpu6050_put_cablic(const char *addr) sys_close(fd); } -static void mpu_get(struct work_struct *work) +static void mpu_get(struct work_struct *mwork) { - struct mpu6050_in *bat = container_of((work), \ + struct mpu6050_in *bat = container_of(container_of(mwork,struct delayed_work,work), \ struct mpu6050_in, delay_work); if(mpu6050_get==1){ @@ -1313,7 +1313,6 @@ static int mpu_parse_dt(struct i2c_client *client, struct property *prop; int debug = 1; int i; - char mAarray[20]; int orig_x,orig_y,orig_z; enum of_gpio_flags irq_flags; int irq_pin; @@ -1439,7 +1438,6 @@ MODULE_DEVICE_TABLE(i2c, mpu_id); int mpu_probe(struct i2c_client *client, const struct i2c_device_id *devid) { - struct mpu_platform_data *pdata; struct mpu_private_data *mpu; struct mldl_cfg *mldl_cfg; int res = 0; @@ -1657,14 +1655,16 @@ static struct i2c_driver mpu_driver = { .resume = mpu_dev_resume, /* optional */ }; -static ssize_t gsensor_check_show(struct device *dev, + +static ssize_t show_gsensor_check(struct device *dev, \ struct device_attribute *attr, char *buf) { return sprintf(buf, "%u\n", Is_cab); } -static ssize_t gsensor_check_store(struct device *dev, - struct device_attribute *attr, char *buf,size_t count) + +static ssize_t gsensor_check_store(struct device *dev, \ + struct device_attribute *attr, const char *buf,size_t count) { switch (buf[0]) { case '1': @@ -1680,18 +1680,17 @@ static ssize_t gsensor_check_store(struct device *dev, return count; } + static ssize_t gsensor_clear_store(struct device *dev, - struct device_attribute *attr, char *buf,size_t count) + struct device_attribute *attr, const char *buf,size_t count) { -// char mtddevname[64]; -// int mtd_index; memset(cablic_arry, 0x00, sizeof(cablic_arry)); gsensor_clear = 1; return count; } -static DEVICE_ATTR(gsensorcheck, 0666, gsensor_check_show, gsensor_check_store); +static DEVICE_ATTR(gsensorcheck, 0666, show_gsensor_check, gsensor_check_store); static DEVICE_ATTR(gsensorclear, 0666, NULL, gsensor_clear_store);