diff options
author | innovaker <66737976+innovaker@users.noreply.github.com> | 2020-11-28 20:03:12 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-12-14 12:41:25 -0500 |
commit | 1411092a7bb6e21e6e3a272737ad36d613e3b367 (patch) | |
tree | a8ec11125f0c76e642aab2f5042e6e9890496ad5 /app/drivers/kscan/kscan_gpio_demux.c | |
parent | 33c959d0318a60a02e016f01adafaf71f4613fc9 (diff) |
refactor(app): replace `driver_data` with `data`
See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html
PR: #467
Diffstat (limited to 'app/drivers/kscan/kscan_gpio_demux.c')
-rw-r--r-- | app/drivers/kscan/kscan_gpio_demux.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/drivers/kscan/kscan_gpio_demux.c b/app/drivers/kscan/kscan_gpio_demux.c index 3ad9d57..f48a09d 100644 --- a/app/drivers/kscan/kscan_gpio_demux.c +++ b/app/drivers/kscan/kscan_gpio_demux.c @@ -69,7 +69,7 @@ struct kscan_gpio_item_config { /* IO/GPIO SETUP */ \ /* gpio_input_devices are PHYSICAL IO devices */ \ static struct device **kscan_gpio_input_devices_##n(struct device *dev) { \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ return data->rows; \ } \ \ @@ -80,7 +80,7 @@ struct kscan_gpio_item_config { \ /* gpio_output_devices are PHYSICAL IO devices */ \ static struct device **kscan_gpio_output_devices_##n(struct device *dev) { \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ return data->cols; \ } \ \ @@ -101,7 +101,7 @@ struct kscan_gpio_item_config { /* This is the core matrix_scan func */ \ static int kscan_gpio_read_##n(struct device *dev) { \ bool submit_follow_up_read = false; \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ static bool read_state[INST_MATRIX_INPUTS(n)][INST_MATRIX_OUTPUTS(n)]; \ for (int o = 0; o < INST_MATRIX_OUTPUTS(n); o++) { \ /* Iterate over bits and set GPIOs accordingly */ \ @@ -153,7 +153,7 @@ struct kscan_gpio_item_config { /* KSCAN API configure function */ \ static int kscan_gpio_configure_##n(struct device *dev, kscan_callback_t callback) { \ LOG_DBG("KSCAN API configure"); \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ if (!callback) { \ return -EINVAL; \ } \ @@ -165,7 +165,7 @@ struct kscan_gpio_item_config { /* KSCAN API enable function */ \ static int kscan_gpio_enable_##n(struct device *dev) { \ LOG_DBG("KSCAN API enable"); \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ /* TODO: we might want a follow up to hook into the sleep state hooks in Zephyr, */ \ /* and disable this timer when we enter a sleep state */ \ k_timer_start(&data->poll_timer, K_MSEC(POLL_INTERVAL(n)), K_MSEC(POLL_INTERVAL(n))); \ @@ -175,7 +175,7 @@ struct kscan_gpio_item_config { /* KSCAN API disable function */ \ static int kscan_gpio_disable_##n(struct device *dev) { \ LOG_DBG("KSCAN API disable"); \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ k_timer_stop(&data->poll_timer); \ return 0; \ }; \ @@ -183,7 +183,7 @@ struct kscan_gpio_item_config { /* GPIO init function*/ \ static int kscan_gpio_init_##n(struct device *dev) { \ LOG_DBG("KSCAN GPIO init"); \ - struct kscan_gpio_data_##n *data = dev->driver_data; \ + struct kscan_gpio_data_##n *data = dev->data; \ int err; \ /* configure input devices*/ \ struct device **input_devices = kscan_gpio_input_devices_##n(dev); \ |