msm: rotator: Pass device pointers to regulator_get()

Passing a device pointer instead of NULL as the first argument
to regulator_get() allows the device to be taken into
account when finding a matching regulator. This removes the need
to specify a unique regulator_name in platform data.

Change-Id: Id16f85866c94b3f3b57aa720cdfbdcf3e2fd241d
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/devices-8064.c b/arch/arm/mach-msm/devices-8064.c
index 5c191c3..4f27241 100644
--- a/arch/arm/mach-msm/devices-8064.c
+++ b/arch/arm/mach-msm/devices-8064.c
@@ -1621,7 +1621,7 @@
 };
 
 struct platform_device *apq8064_footswitch[] __initdata = {
-	FS_8X60(FS_ROT,    "fs_rot",	NULL,	&rot_fs_data),
+	FS_8X60(FS_ROT,    "vdd",	"msm_rotator.0", &rot_fs_data),
 	FS_8X60(FS_IJPEG,  "fs_ijpeg",	NULL,	&ijpeg_fs_data),
 	FS_8X60(FS_VFE,    "fs_vfe",	NULL,	&vfe_fs_data),
 	FS_8X60(FS_VPE,    "fs_vpe",	NULL,	&vpe_fs_data),
diff --git a/arch/arm/mach-msm/devices-8930.c b/arch/arm/mach-msm/devices-8930.c
index 609b2e2..5d50d5f 100644
--- a/arch/arm/mach-msm/devices-8930.c
+++ b/arch/arm/mach-msm/devices-8930.c
@@ -431,7 +431,7 @@
 
 struct platform_device *msm8930_footswitch[] __initdata = {
 	FS_8X60(FS_MDP,    "vdd",	"mdp.0",	&mdp_fs_data),
-	FS_8X60(FS_ROT,    "fs_rot",	NULL,	&rot_fs_data),
+	FS_8X60(FS_ROT,    "vdd",	"msm_rotator.0", &rot_fs_data),
 	FS_8X60(FS_IJPEG,  "fs_ijpeg",	NULL,	&ijpeg_fs_data),
 	FS_8X60(FS_VFE,    "fs_vfe",	NULL,	&vfe_fs_data),
 	FS_8X60(FS_VPE,    "fs_vpe",	NULL,	&vpe_fs_data),
diff --git a/arch/arm/mach-msm/devices-8960.c b/arch/arm/mach-msm/devices-8960.c
index ba95e09..bcaee48 100644
--- a/arch/arm/mach-msm/devices-8960.c
+++ b/arch/arm/mach-msm/devices-8960.c
@@ -2072,7 +2072,7 @@
 
 struct platform_device *msm8960_footswitch[] __initdata = {
 	FS_8X60(FS_MDP,    "vdd",	"mdp.0",	&mdp_fs_data),
-	FS_8X60(FS_ROT,    "fs_rot",	NULL,	&rot_fs_data),
+	FS_8X60(FS_ROT,    "vdd",	"msm_rotator.0", &rot_fs_data),
 	FS_8X60(FS_IJPEG,  "fs_ijpeg",	NULL,	&ijpeg_fs_data),
 	FS_8X60(FS_VFE,    "fs_vfe",	NULL,	&vfe_fs_data),
 	FS_8X60(FS_VPE,    "fs_vpe",	NULL,	&vpe_fs_data),
@@ -2195,7 +2195,6 @@
 	.number_of_clocks = ARRAY_SIZE(rotator_clocks),
 	.hardware_version_number = 0x01020309,
 	.rotator_clks = rotator_clocks,
-	.regulator_name = "fs_rot",
 #ifdef CONFIG_MSM_BUS_SCALING
 	.bus_scale_table = &rotator_bus_scale_pdata,
 #endif
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index 489c32d..e055579 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -1187,7 +1187,6 @@
 	.number_of_clocks = ARRAY_SIZE(rotator_clocks),
 	.hardware_version_number = 0x1000303,
 	.rotator_clks = rotator_clocks,
-	.regulator_name = "fs_rot",
 };
 
 struct platform_device msm_rotator_device = {
@@ -1349,7 +1348,7 @@
 	FS_PCOM(FS_GFX3D,  "vdd", "kgsl-3d0.0"),
 	FS_PCOM(FS_MDP,    "vdd", "mdp.0"),
 	FS_PCOM(FS_MFC,    "fs_mfc",    NULL),
-	FS_PCOM(FS_ROT,    "fs_rot",    NULL),
+	FS_PCOM(FS_ROT,    "vdd",  "msm_rotator.0"),
 	FS_PCOM(FS_VFE,    "fs_vfe",    NULL),
 	FS_PCOM(FS_VPE,    "fs_vpe",    NULL),
 };
diff --git a/arch/arm/mach-msm/devices-msm8x60.c b/arch/arm/mach-msm/devices-msm8x60.c
index 1d6c338..5289fa6 100644
--- a/arch/arm/mach-msm/devices-msm8x60.c
+++ b/arch/arm/mach-msm/devices-msm8x60.c
@@ -1547,7 +1547,6 @@
 	.number_of_clocks = ARRAY_SIZE(rotator_clocks),
 	.hardware_version_number = 0x01010307,
 	.rotator_clks = rotator_clocks,
-	.regulator_name = "fs_rot",
 #ifdef CONFIG_MSM_BUS_SCALING
 	.bus_scale_table = &rotator_bus_scale_pdata,
 #endif
@@ -2659,7 +2658,7 @@
 struct platform_device *msm8660_footswitch[] __initdata = {
 	FS_8X60(FS_IJPEG,  "fs_ijpeg",	NULL,	&ijpeg_fs_data),
 	FS_8X60(FS_MDP,    "vdd",	"mdp.0",	&mdp_fs_data),
-	FS_8X60(FS_ROT,    "fs_rot",	NULL,	&rot_fs_data),
+	FS_8X60(FS_ROT,    "vdd",	"msm_rotator.0", &rot_fs_data),
 	FS_8X60(FS_VED,    "vdd",	"msm_vidc.0",	&ved_fs_data),
 	FS_8X60(FS_VFE,    "fs_vfe",	NULL,	&vfe_fs_data),
 	FS_8X60(FS_VPE,    "fs_vpe",	NULL,	&vpe_fs_data),
diff --git a/drivers/char/msm_rotator.c b/drivers/char/msm_rotator.c
index 865fcc2..b457a00 100644
--- a/drivers/char/msm_rotator.c
+++ b/drivers/char/msm_rotator.c
@@ -1562,7 +1562,8 @@
 		}
 	}
 
-	msm_rotator_dev->regulator = regulator_get(NULL, pdata->regulator_name);
+	msm_rotator_dev->regulator = regulator_get(&msm_rotator_dev->pdev->dev,
+						   "vdd");
 	if (IS_ERR(msm_rotator_dev->regulator))
 		msm_rotator_dev->regulator = NULL;
 
diff --git a/include/linux/msm_rotator.h b/include/linux/msm_rotator.h
index 02ffd59..0f15a8b 100644
--- a/include/linux/msm_rotator.h
+++ b/include/linux/msm_rotator.h
@@ -52,7 +52,6 @@
 	unsigned int number_of_clocks;
 	unsigned int hardware_version_number;
 	struct msm_rot_clocks *rotator_clks;
-	const char *regulator_name;
 #ifdef CONFIG_MSM_BUS_SCALING
 	struct msm_bus_scale_pdata *bus_scale_table;
 #endif