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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
 drivers/media/video/noon010pc30.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

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)
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux