fix some warning for mpu6050

This commit is contained in:
ywj
2014-06-26 10:59:32 +08:00
parent 7091eb42d6
commit 39e5cf1b68
4 changed files with 12 additions and 16 deletions

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);