diff mbox

[3/3] noon010pc30: Clean up the s_power callback

Message ID 1308757470-24421-4-git-send-email-s.nawrocki@samsung.com (mailing list archive)
State RFC
Headers show

Commit Message

Remove unneeded check for the platform data in s_power operation
and reorder the code to use early return path. There is no functional
changes in this patch.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/video/noon010pc30.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/video/noon010pc30.c b/drivers/media/video/noon010pc30.c
index 6920cc4..99b58d0 100644
--- a/drivers/media/video/noon010pc30.c
+++ b/drivers/media/video/noon010pc30.c
@@ -588,25 +588,19 @@  static int noon010_base_config(struct v4l2_subdev *sd)
 static int noon010_s_power(struct v4l2_subdev *sd, int on)
 {
 	struct noon010_info *info = to_noon010(sd);
-	const struct noon010pc30_platform_data *pdata = info->pdata;
-	int ret = 0;
-
-	if (WARN(pdata == NULL, "No platform data!\n"))
-		return -ENOMEM;
+	int ret;
 
 	if (on) {
 		ret = power_enable(info);
 		if (ret)
 			return ret;
-		ret = noon010_base_config(sd);
-	} else {
-		noon010_power_ctrl(sd, false, true);
-		ret = power_disable(info);
-		info->curr_win = NULL;
-		info->curr_fmt = NULL;
+		return noon010_base_config(sd);
 	}
 
-	return ret;
+	noon010_power_ctrl(sd, false, true);
+	info->curr_win = NULL;
+	info->curr_fmt = NULL;
+	return power_disable(info);
 }
 
 static int noon010_s_stream(struct v4l2_subdev *sd, int on)