uvc: check ioctl return value for error

There is code that is meant to check for the error of an ioctl, but the
return variable that it checks isn't actually assigned from the ioctl.
Assign the return value before checking it.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
[Fixed error message]
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
1 file changed
tree: 21bf8fa1fa126a5d80162d960f25c136f7f5efcf
  1. include/
  2. lib/
  3. scripts/
  4. .gitignore
  5. CMakeLists.txt
  6. main.c
  7. README.md
README.md

uvcgadget - UVC gadget C library

uvcgadget is a pure C library that implements handling of UVC gadget functions.

Utilities

  • uvc-gadget - Sample test application

Build instructions:

To compile:

$ mkdir build
$ cd build
$ cmake ..
$ make -j4

Cross compiling instructions:

Directions for cross compiling depend on the build environment.

For buildroot-based builds, cmake can be pointed to the toolchain file provided by buildroot:

$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/output/host/usr/share/buildroot/toolchainfile.cmake ..
$ make -j4

If your build environment doesn't provide a CMake toolchain file, the following template can be used as a starting point.

set(CMAKE_SYSTEM_NAME Linux)

set(BUILD_ENV_ROOT "/path/to/your/build/enviroment/root/")

# Specify the cross compiler
set(CMAKE_C_COMPILER   ${BUILD_ENV_ROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)

# Where is the target environment
set(CMAKE_FIND_ROOT_PATH ${BUILD_ENV_ROOT}/target ${BUILD_ENV_ROOT}/host)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)