USB: android: Rate limit android enable warning

An error message is printed when user space tries to enable/disable
android configuration when it is already enabled/disabled.  This
message is helpful in debugging USB composition issues.  However
this message is getting flooded in an error condition.  If serial
console is enabled, it is leading to watchdog bark.

CRs-Fixed: 457725
Change-Id: I2d61ac46ba3c8464bada23a64ad0d8027a4adfe9
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 5b83cb4..52ea9e1 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -2105,6 +2105,7 @@
 	struct android_usb_function *f;
 	struct android_configuration *conf;
 	int enabled = 0;
+	static DEFINE_RATELIMIT_STATE(rl, 10*HZ, 1);
 
 	if (!cdev)
 		return -ENODEV;
@@ -2140,7 +2141,7 @@
 					f->disable(f);
 			}
 		dev->enabled = false;
-	} else {
+	} else if (__ratelimit(&rl)) {
 		pr_err("android_usb: already %s\n",
 				dev->enabled ? "enabled" : "disabled");
 	}