linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gspca: add a missed check for goto_low_power
@ 2018-12-25  8:24 Kangjie Lu
  0 siblings, 0 replies; only message in thread
From: Kangjie Lu @ 2018-12-25  8:24 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Hans Verkuil, Mauro Carvalho Chehab, linux-media, linux-kernel

The fix checks if goto_low_power() fails, and if so, issues an error
message.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/media/usb/gspca/cpia1.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c
index 23fbda56fc91..7c817a4a93c4 100644
--- a/drivers/media/usb/gspca/cpia1.c
+++ b/drivers/media/usb/gspca/cpia1.c
@@ -1434,6 +1434,7 @@ static int sd_config(struct gspca_dev *gspca_dev,
 {
 	struct sd *sd = (struct sd *) gspca_dev;
 	struct cam *cam;
+	int ret;
 
 	sd->mainsFreq = FREQ_DEF == V4L2_CID_POWER_LINE_FREQUENCY_60HZ;
 	reset_camera_params(gspca_dev);
@@ -1445,7 +1446,10 @@ static int sd_config(struct gspca_dev *gspca_dev,
 	cam->cam_mode = mode;
 	cam->nmodes = ARRAY_SIZE(mode);
 
-	goto_low_power(gspca_dev);
+	ret = goto_low_power(gspca_dev);
+	if (ret)
+		gspca_err(gspca_dev, "Cannot go to low power mode: %d\n",
+			  ret);
 	/* Check the firmware version. */
 	sd->params.version.firmwareVersion = 0;
 	get_version_information(gspca_dev);
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-25  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25  8:24 [PATCH] usb: gspca: add a missed check for goto_low_power Kangjie Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).