core: remove deprecated functions
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 14 Oct 2020 08:26:54 +0000 (10:26 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 14 Oct 2020 08:26:54 +0000 (10:26 +0200)
Drop all deprecated interfaces now that we're allowed to change the API
for libgpiod v2.0.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
include/gpiod.h
lib/core.c
lib/ctxless.c

index 3477f9d341d319dfc1c4d0059d1b0754633646b3..e684ab1e002cc1e6b1d7fc59e304b01d66d8ee68 100644 (file)
@@ -73,11 +73,6 @@ struct gpiod_line_bulk;
  */
 #define GPIOD_BIT(nr)          (1UL << (nr))
 
-/**
- * @brief Marks a public function as deprecated.
- */
-#define GPIOD_DEPRECATED       __attribute__((deprecated))
-
 /**
  * @}
  *
@@ -337,71 +332,6 @@ typedef int (*gpiod_ctxless_event_poll_cb)(unsigned int,
                                struct gpiod_ctxless_event_poll_fd *,
                                const struct timespec *, void *);
 
-/**
- * @brief Wait for events on a single GPIO line.
- * @param device Name, path, number or label of the gpiochip.
- * @param offset GPIO line offset to monitor.
- * @param active_low The active state of this line - true if low.
- * @param consumer Name of the consumer.
- * @param timeout Maximum wait time for each iteration.
- * @param poll_cb Callback function to call when waiting for events.
- * @param event_cb Callback function to call for each line event.
- * @param data User data passed to the callback.
- * @return 0 if no errors were encountered, -1 if an error occurred.
- * @note The way the ctxless event loop works is described in detail in
- *       ::gpiod_ctxless_event_loop_multiple - this is just a wrapper aound
- *       this routine which calls it for a single GPIO line.
- * @deprecated This function suffers from an issue where HW may not allow
- *             setting up both rising and falling egde interrupts at the same
- *             time.
- */
-int gpiod_ctxless_event_loop(const char *device, unsigned int offset,
-                            bool active_low, const char *consumer,
-                            const struct timespec *timeout,
-                            gpiod_ctxless_event_poll_cb poll_cb,
-                            gpiod_ctxless_event_handle_cb event_cb,
-                            void *data) GPIOD_API GPIOD_DEPRECATED;
-
-/**
- * @brief Wait for events on multiple GPIO lines.
- * @param device Name, path, number or label of the gpiochip.
- * @param offsets Array of GPIO line offsets to monitor.
- * @param num_lines Number of lines to monitor.
- * @param active_low The active state of this line - true if low.
- * @param consumer Name of the consumer.
- * @param timeout Maximum wait time for each iteration.
- * @param poll_cb Callback function to call when waiting for events. Can
- *                be NULL.
- * @param event_cb Callback function to call on event occurrence.
- * @param data User data passed to the callback.
- * @return 0 no errors were encountered, -1 if an error occurred.
- * @note The poll callback can be NULL in which case the routine will fall
- *       back to a basic, ppoll() based callback.
- * @deprecated This function suffers from an issue where HW may not allow
- *             setting up both rising and falling egde interrupts at the same
- *             time.
- *
- * Internally this routine opens the GPIO chip, requests the set of lines for
- * both-edges events and calls the polling callback in a loop. The role of the
- * polling callback is to detect input events on a set of file descriptors and
- * notify the caller about the fds ready for reading.
- *
- * The ctxless event loop then reads each queued event from marked descriptors
- * and calls the event callback. Both callbacks can stop the loop at any
- * point.
- *
- * The poll_cb argument can be NULL in which case the function falls back to
- * a default, ppoll() based callback.
- */
-int gpiod_ctxless_event_loop_multiple(const char *device,
-                                     const unsigned int *offsets,
-                                     unsigned int num_lines, bool active_low,
-                                     const char *consumer,
-                                     const struct timespec *timeout,
-                                     gpiod_ctxless_event_poll_cb poll_cb,
-                                     gpiod_ctxless_event_handle_cb event_cb,
-                                     void *data) GPIOD_API GPIOD_DEPRECATED;
-
 /**
  * @brief Wait for events on a single GPIO line.
  * @param device Name, path, number or label of the gpiochip.
@@ -946,16 +876,6 @@ bool gpiod_line_is_open_source(struct gpiod_line *line) GPIOD_API;
  */
 int gpiod_line_update(struct gpiod_line *line) GPIOD_API;
 
-/**
- * @brief Check if the line info needs to be updated.
- * @param line GPIO line object.
- * @return Always returns false.
- * @deprecated This mechanism no longer exists in the library and this function
- *             does nothing.
- */
-bool
-gpiod_line_needs_update(struct gpiod_line *line) GPIOD_API GPIOD_DEPRECATED;
-
 /**
  * @}
  *
index b9642723a2e42ea743328e746893dd7abeed513b..74d092b9d0e0b8383e488f11bac6bae6195e477c 100644 (file)
@@ -398,11 +398,6 @@ bool gpiod_line_is_open_source(struct gpiod_line *line)
        return line->info_flags & GPIOLINE_FLAG_OPEN_SOURCE;
 }
 
-bool gpiod_line_needs_update(struct gpiod_line *line GPIOD_UNUSED)
-{
-       return false;
-}
-
 int gpiod_line_update(struct gpiod_line *line)
 {
        struct gpioline_info info;
index 014475c7918a0359983a8b236cc29a28f12c7376..bcffdb37ecba1ccadc3e0d01675fdb8a162cafb8 100644 (file)
@@ -242,34 +242,6 @@ static int basic_event_poll(unsigned int num_lines,
        return ret;
 }
 
-int gpiod_ctxless_event_loop(const char *device, unsigned int offset,
-                            bool active_low, const char *consumer,
-                            const struct timespec *timeout,
-                            gpiod_ctxless_event_poll_cb poll_cb,
-                            gpiod_ctxless_event_handle_cb event_cb,
-                            void *data)
-{
-       return gpiod_ctxless_event_monitor(device,
-                                          GPIOD_CTXLESS_EVENT_BOTH_EDGES,
-                                          offset, active_low, consumer,
-                                          timeout, poll_cb, event_cb, data);
-}
-
-int gpiod_ctxless_event_loop_multiple(const char *device,
-                                     const unsigned int *offsets,
-                                     unsigned int num_lines, bool active_low,
-                                     const char *consumer,
-                                     const struct timespec *timeout,
-                                     gpiod_ctxless_event_poll_cb poll_cb,
-                                     gpiod_ctxless_event_handle_cb event_cb,
-                                     void *data)
-{
-       return gpiod_ctxless_event_monitor_multiple(
-                               device, GPIOD_CTXLESS_EVENT_BOTH_EDGES,
-                               offsets, num_lines, active_low, consumer,
-                               timeout, poll_cb, event_cb, data);
-}
-
 int gpiod_ctxless_event_monitor(const char *device, int event_type,
                                unsigned int offset, bool active_low,
                                const char *consumer,