checkpatch: Add check for vreg_xxx api in opensource drivers

Vreg API implementation is deprecated. We are using
Linux regulator framework now. Hence vreg API should
not be used.

Change-Id: I8e31dac66592d2d195d190b770a436e93206cf8b
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1f4b2f8..0d41625 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2791,6 +2791,12 @@
 		WARN("Non gpiomux board file cannot have a gpiomux config declarations. Please declare gpiomux configs in board-*-gpiomux.c file.\n" . $herecurr);
 	}
 
+# MSM - check if vreg_xxx function are used
+	if ($line =~ /\b(vreg_(get|put|set_level|enable|disable))\b/) {
+		WARN("Use of $1 API is deprecated: " .
+			"use regulator APIs\n" . $herecurr);
+	}
+
 # unbounded string functions are overflow risks
 		my %str_fns = (
 			"sprintf" => "snprintf",