Merge tag 'v4.4-rc2'
[firefly-linux-kernel-4.4.55.git] / drivers / bluetooth / vflash.c
index 44070a74b352c434180a62bb741f48bb7e5a7cc6..bb37c739571860becfe89a706b3e54a44890dec7 100755 (executable)
@@ -34,11 +34,10 @@ static struct miscdevice vflash_miscdev;
 extern char GetSNSectorInfo(char * pbuf);\r
 extern unsigned char wlan_mac_addr[6];\r
 \r
-static int vflash_ioctl(struct inode *inode, struct file *file,\r
+static long vflash_ioctl(struct file *file,\r
                                        unsigned int cmd, unsigned long arg)\r
 {\r
        void __user *argp = (void __user *)arg;\r
-    unsigned long n = 0;\r
     \r
     DBG("%s---cmd=0x%x---arg=0x%x\n", __FUNCTION__, cmd, arg);\r
 \r
@@ -49,7 +48,7 @@ static int vflash_ioctl(struct inode *inode, struct file *file,
     {\r
         case READ_BDADDR_FROM_FLASH:\r
         {   \r
-#if CONFIG_WIFI_MAC\r
+#ifdef CONFIG_WIFI_MAC\r
             unsigned char bd_addr[6] = {0};\r
             int i;\r
 \r
@@ -79,7 +78,7 @@ static int vflash_ioctl(struct inode *inode, struct file *file,
             }\r
 #else\r
             char *tempBuf = (char *)kmalloc(512, GFP_KERNEL);\r
-           char bd_addr[6] = {0};\r
+           char bd_addr[7] = {0};\r
             int i;\r
 \r
             GetSNSectorInfo(tempBuf);\r
@@ -91,11 +90,13 @@ static int vflash_ioctl(struct inode *inode, struct file *file,
             }\r
 \r
             \r
+            //printk("%s: ====> get bt addr from flash=[%02x:%02x:%02x:%02x:%02x:%02x]\n", __FUNCTION__,\r
+            //      bd_addr[5], bd_addr[4], bd_addr[3], bd_addr[2], bd_addr[1], bd_addr[0]);\r
            if(copy_to_user(argp, bd_addr, 6))\r
-                       {\r
-                           printk("ERROR: copy_to_user---%s\n", __FUNCTION__);\r
+            {\r
+                printk("ERROR: copy_to_user---%s\n", __FUNCTION__);\r
                 kfree(tempBuf);\r
-                           return -EFAULT;\r
+                return -EFAULT;\r
             }\r
             \r
             kfree(tempBuf);\r