Merge remote-tracking branch 'common/android-3.0' into develop-3.0-jb
[firefly-linux-kernel-4.4.55.git] / drivers / usb / gadget / f_adb.c
index 83e1f59385a2f3f697b5433a00c6b2e1796502ae..de61944d780f3937710dc81c050d603360a51510 100755 (executable)
@@ -111,6 +111,8 @@ static struct usb_descriptor_header *hs_adb_descs[] = {
        NULL,
 };
 
+static void adb_ready_callback(void);
+static void adb_closed_callback(void);
 
 /* temporary variable used between adb_open() and adb_gadget_bind() */
 static struct adb_dev *_adb_dev;
@@ -406,7 +408,7 @@ static ssize_t adb_write(struct file *fp, const char __user *buf,
 
 static int adb_open(struct inode *ip, struct file *fp)
 {
-       printk(KERN_INFO "adb_open\n");
+       pr_info("adb_open\n");
        if (!_adb_dev)
                return -ENODEV;
 
@@ -418,12 +420,17 @@ static int adb_open(struct inode *ip, struct file *fp)
        /* clear the error latch */
        _adb_dev->error = 0;
 
+       adb_ready_callback();
+
        return 0;
 }
 
 static int adb_release(struct inode *ip, struct file *fp)
 {
-       printk(KERN_INFO "adb_release\n");
+       pr_info("adb_release\n");
+
+       adb_closed_callback();
+
        adb_unlock(&_adb_dev->open_excl);
        return 0;
 }