\r
#define AK8963_DEVICE_ID 0x48\r
static struct i2c_client *this_client;\r
+static struct miscdevice compass_dev_device;\r
\r
static short g_akm_rbuf[12];\r
\r
if((info & (0x0f<<3)) != AK8963_INFO_DATA)\r
{\r
printk("%s:info=0x%x,it is not %s\n",__func__, info, sensor->ops->name);\r
- result = -1;\r
+ return -1;\r
}\r
\r
+ result = misc_register(&compass_dev_device);\r
+ if (result < 0) {\r
+ printk("%s:fail to register misc device %s\n", __func__, compass_dev_device.name);\r
+ result = -1;\r
+ }\r
+ \r
DBG("%s:status_cur=%d\n",__func__, sensor->status_cur);\r
return result;\r
}\r
int result = 0;\r
int type = ops->type;\r
result = sensor_register_slave(type, NULL, NULL, compass_get_ops);\r
-\r
- result = misc_register(&compass_dev_device);\r
- if (result < 0) {\r
- printk("%s:fail to register misc device %s\n", __func__, compass_dev_device.name);\r
- goto error;\r
- }\r
-error: \r
+ \r
return result;\r
}\r
\r
\r
#define AK8975_DEVICE_ID 0x48\r
static struct i2c_client *this_client;\r
+static struct miscdevice compass_dev_device;\r
\r
\r
\r
\r
{\r
printk("%s:info=0x%x,it is not %s\n",__func__, info, sensor->ops->name);\r
+ return -1;\r
+ }\r
+\r
+ result = misc_register(&compass_dev_device);\r
+ if (result < 0) {\r
+ printk("%s:fail to register misc device %s\n", __func__, compass_dev_device.name);\r
result = -1;\r
}\r
\r
int result = 0;\r
int type = ops->type;\r
result = sensor_register_slave(type, NULL, NULL, compass_get_ops);\r
-\r
- result = misc_register(&compass_dev_device);\r
- if (result < 0) {\r
- printk("%s:fail to register misc device %s\n", __func__, compass_dev_device.name);\r
- goto error;\r
- }\r
-error: \r
+ \r
return result;\r
}\r
\r