@@ -1624,7 +1624,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
static void sd_stopN(struct gspca_dev *gspca_dev)
{
+#if IS_ENABLED(CONFIG_INPUT)
struct sd *sd = (struct sd *) gspca_dev;
+#endif
command_pause(gspca_dev);
@@ -243,7 +243,9 @@ static int sd_start(struct gspca_dev *gspca_dev)
static void sd_stopN(struct gspca_dev *gspca_dev)
{
+#if IS_ENABLED(CONFIG_INPUT)
struct sd *sd = (struct sd *) gspca_dev;
+#endif
konica_stream_off(gspca_dev);
#if IS_ENABLED(CONFIG_INPUT)
@@ -837,11 +837,12 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
u8 *data, /* isoc packet */
int len) /* iso packet length */
{
- struct sd *sd = (struct sd *) gspca_dev;
int pkt_type;
if (data[0] == 0x5a) {
#if IS_ENABLED(CONFIG_INPUT)
+ struct sd *sd = (struct sd *) gspca_dev;
+
if (len > 20) {
u8 state = (data[20] & 0x80) ? 1 : 0;
if (sd->button_pressed != state) {
When CONFIG_INPUT is disabled, multiple gspca backend drivers print compile-time warnings about unused variables: media/usb/gspca/cpia1.c: In function 'sd_stopN': media/usb/gspca/cpia1.c:1627:13: error: unused variable 'sd' [-Werror=unused-variable] media/usb/gspca/konica.c: In function 'sd_stopN': media/usb/gspca/konica.c:246:13: error: unused variable 'sd' [-Werror=unused-variable] This encloses the declarations in #ifdef CONFIG_INPUT, just like the code using them is. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: ee186fd96a5f ("[media] gscpa_t613: Add support for the camera button") Fixes: c2f644aeeba3 ("[media] gspca_cpia1: Add support for button") Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams") --- drivers/media/usb/gspca/cpia1.c | 2 ++ drivers/media/usb/gspca/konica.c | 2 ++ drivers/media/usb/gspca/t613.c | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) -- 2.7.0