Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backends API rework #1059

Merged
merged 6 commits into from
Oct 10, 2023
Merged

Backends API rework #1059

merged 6 commits into from
Oct 10, 2023

Commits on Sep 27, 2023

  1. context: Constify 'iio_backends' array

    This array contains data known at compile-time and is never updated
    later; so it can be const.
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    8f6f889 View commit details
    Browse the repository at this point in the history
  2. dynamic: Remove duplicated error message

    We only need to print it once; and it makes more sense to print it at
    the "debug" log level.
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    091891e View commit details
    Browse the repository at this point in the history
  3. iio: Rework API functions to get backends

    They previously would only work with the backends provided by Libiio,
    either built-in or modules, enabled at compilation time.
    
    This meant that third-party modules were not listed in there, while
    official modules were.
    
    Change these functions so that they only work for built-in backends, and
    rename them to iio_get_builtin_backends_count() and
    iio_get_builtin_backend().
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    271016e View commit details
    Browse the repository at this point in the history
  4. iio: Support dynamic backends in iio_has_backend()

    If the backend name cannot be found in the list of built-in backends,
    check if a module exists for it.
    
    Since the loading of a dynamic backend might print errors (e.g. if the
    file is unrecognized), the iio_has_backend() function now accepts an
    extra "params" argument.
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    cd973ed View commit details
    Browse the repository at this point in the history
  5. compat: Update to new backend functions

    Update to the new prototype of iio_has_backend(), and use the new
    functions iio_get_builtin_backends_count() and
    iio_get_builtin_backend().
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    7aaeebf View commit details
    Browse the repository at this point in the history
  6. utils: Update to the new backend functions

    Use the new functions iio_get_builtin_backends_count() and
    iio_get_builtin_backend().
    
    Signed-off-by: Paul Cercueil <[email protected]>
    pcercuei committed Sep 27, 2023
    Configuration menu
    Copy the full SHA
    598dcef View commit details
    Browse the repository at this point in the history