regulator: core: Fix return code for invalid parameters

We should be returning an error, a repeated call will never succeed.

Signed-off-by: Mark Brown <[email protected]>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 66ae12d..ad15424 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1288,7 +1288,7 @@
 
 	if (id == NULL) {
 		pr_err("get() with no identifier\n");
-		return regulator;
+		return ERR_PTR(-EINVAL);
 	}
 
 	if (dev)