input: gpio_keys: fix CONTAINER_OF declaration
Fix CONTAINER_OF usage in gpio_keys_interrupt, this should go first to struct gpio_keys_callback and then to struct gpio_keys_pin_data. It happens to work right now because cb_data is the first field. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
ec71be5d9d
commit
2401743c21
|
@ -79,8 +79,10 @@ static void gpio_keys_interrupt(const struct device *dev, struct gpio_callback *
|
|||
ARG_UNUSED(dev); /* This is a pointer to GPIO device, use dev pointer in
|
||||
* cbdata for pointer to gpio_debounce device node
|
||||
*/
|
||||
struct gpio_keys_pin_data *pin_data =
|
||||
CONTAINER_OF(cbdata, struct gpio_keys_pin_data, cb_data);
|
||||
struct gpio_keys_callback *keys_cb = CONTAINER_OF(
|
||||
cbdata, struct gpio_keys_callback, gpio_cb);
|
||||
struct gpio_keys_pin_data *pin_data = CONTAINER_OF(
|
||||
keys_cb, struct gpio_keys_pin_data, cb_data);
|
||||
const struct gpio_keys_config *cfg = pin_data->dev->config;
|
||||
|
||||
for (int i = 0; i < cfg->num_keys; i++) {
|
||||
|
|
Loading…
Reference in New Issue