forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/usb/gspca/cpia1.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * cpia CPiA (1) gspca driver
34 *
....@@ -9,17 +10,6 @@
910 * (C) Copyright 1999-2000 Scott J. Bertin
1011 * (C) Copyright 1999-2000 Johannes Erdfelt <johannes@erdfelt.com>
1112 * (C) Copyright 2000 STMicroelectronics
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
22
- *
2313 */
2414
2515 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -547,10 +537,14 @@
547537 }
548538 if (sd->params.qx3.button) {
549539 /* button pressed - unlock the latch */
550
- do_command(gspca_dev, CPIA_COMMAND_WriteMCPort,
540
+ ret = do_command(gspca_dev, CPIA_COMMAND_WriteMCPort,
551541 3, 0xdf, 0xdf, 0);
552
- do_command(gspca_dev, CPIA_COMMAND_WriteMCPort,
542
+ if (ret)
543
+ return ret;
544
+ ret = do_command(gspca_dev, CPIA_COMMAND_WriteMCPort,
553545 3, 0xff, 0xff, 0);
546
+ if (ret)
547
+ return ret;
554548 }
555549
556550 /* test whether microscope is cradled */