device: Apply driver_api/data attributes rename everywhere
Via coccinelle: @r_device_driver_api_and_data_1@ struct device *D; @@ ( D-> - driver_api + api | D-> - driver_data + data ) @r_device_driver_api_and_data_2@ expression E; @@ ( net_if_get_device(E)-> - driver_api + api | net_if_get_device(E)-> - driver_data + data ) And grep/sed rules for macros: git grep -rlz 'dev)->driver_data' | xargs -0 sed -i 's/dev)->driver_data/dev)->data/g' git grep -rlz 'dev->driver_data' | xargs -0 sed -i 's/dev->driver_data/dev->data/g' git grep -rlz 'device->driver_data' | xargs -0 sed -i 's/device->driver_data/device->data/g' Fixes #27397 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
d86f79cbd7
commit
98d9b01322
498 changed files with 2085 additions and 2087 deletions
|
@ -42,7 +42,7 @@ static void can_msgq_put(struct zcan_frame *frame, void *arg)
|
|||
int z_impl_can_attach_msgq(struct device *dev, struct k_msgq *msg_q,
|
||||
const struct zcan_filter *filter)
|
||||
{
|
||||
const struct can_driver_api *api = dev->driver_api;
|
||||
const struct can_driver_api *api = dev->api;
|
||||
|
||||
return api->attach_isr(dev, can_msgq_put, msg_q, filter);
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ int can_attach_workq(struct device *dev, struct k_work_q *work_q,
|
|||
can_rx_callback_t callback, void *callback_arg,
|
||||
const struct zcan_filter *filter)
|
||||
{
|
||||
const struct can_driver_api *api = dev->driver_api;
|
||||
const struct can_driver_api *api = dev->api;
|
||||
|
||||
k_work_init(&work->work_item, can_work_handler);
|
||||
work->work_queue = work_q;
|
||||
|
|
|
@ -288,7 +288,7 @@ DEVICE_AND_API_INIT(can_loopback_1, CONFIG_CAN_LOOPBACK_DEV_NAME,
|
|||
static int socket_can_init_1(struct device *dev)
|
||||
{
|
||||
struct device *can_dev = DEVICE_GET(can_loopback_1);
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
|
||||
dev, dev->name, can_dev, can_dev->name);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <drivers/can.h>
|
||||
|
||||
#define DEV_DATA(dev) ((struct can_loopback_data *const)(dev)->driver_data)
|
||||
#define DEV_DATA(dev) ((struct can_loopback_data *const)(dev)->data)
|
||||
#define DEV_CFG(dev) \
|
||||
((const struct can_loopback_config *const)(dev)->config)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#define DEV_CFG(dev) \
|
||||
((const struct mcp2515_config *const)(dev)->config)
|
||||
#define DEV_DATA(dev) ((struct mcp2515_data *const)(dev)->driver_data)
|
||||
#define DEV_DATA(dev) ((struct mcp2515_data *const)(dev)->data)
|
||||
|
||||
struct mcp2515_tx_cb {
|
||||
struct k_sem sem;
|
||||
|
|
|
@ -250,7 +250,7 @@ static int mcux_flexcan_send(struct device *dev, const struct zcan_frame *msg,
|
|||
can_tx_callback_t callback_isr, void *callback_arg)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
flexcan_mb_transfer_t xfer;
|
||||
status_t status;
|
||||
int alloc;
|
||||
|
@ -300,7 +300,7 @@ static int mcux_flexcan_attach_isr(struct device *dev, can_rx_callback_t isr,
|
|||
const struct zcan_filter *filter)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
flexcan_mb_transfer_t xfer;
|
||||
status_t status;
|
||||
uint32_t mask;
|
||||
|
@ -353,7 +353,7 @@ static int mcux_flexcan_attach_isr(struct device *dev, can_rx_callback_t isr,
|
|||
static void mcux_flexcan_register_state_change_isr(struct device *dev,
|
||||
can_state_change_isr_t isr)
|
||||
{
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
|
||||
data->state_change_isr = isr;
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ int mcux_flexcan_recover(struct device *dev, k_timeout_t timeout)
|
|||
static void mcux_flexcan_detach(struct device *dev, int filter_id)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
|
||||
if (filter_id >= MCUX_FLEXCAN_MAX_RX) {
|
||||
LOG_ERR("Detach: Filter id >= MAX_RX (%d >= %d)", filter_id,
|
||||
|
@ -444,7 +444,7 @@ static inline void mcux_flexcan_transfer_error_status(struct device *dev,
|
|||
uint32_t error)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
can_tx_callback_t function;
|
||||
int status = CAN_TX_OK;
|
||||
void *arg;
|
||||
|
@ -520,7 +520,7 @@ static inline void mcux_flexcan_transfer_error_status(struct device *dev,
|
|||
static inline void mcux_flexcan_transfer_tx_idle(struct device *dev,
|
||||
uint32_t mb)
|
||||
{
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
can_tx_callback_t function;
|
||||
void *arg;
|
||||
int alloc;
|
||||
|
@ -546,7 +546,7 @@ static inline void mcux_flexcan_transfer_rx_idle(struct device *dev,
|
|||
uint32_t mb)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
can_rx_callback_t function;
|
||||
flexcan_mb_transfer_t xfer;
|
||||
struct zcan_frame frame;
|
||||
|
@ -611,7 +611,7 @@ static void mcux_flexcan_isr(void *arg)
|
|||
{
|
||||
struct device *dev = (struct device *)arg;
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
|
||||
FLEXCAN_TransferHandleIRQ(config->base, &data->handle);
|
||||
}
|
||||
|
@ -619,7 +619,7 @@ static void mcux_flexcan_isr(void *arg)
|
|||
static int mcux_flexcan_init(struct device *dev)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->driver_data;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
int err;
|
||||
int i;
|
||||
|
||||
|
@ -734,7 +734,7 @@ static void mcux_flexcan_config_func_0(struct device *dev)
|
|||
static int socket_can_init_0(struct device *dev)
|
||||
{
|
||||
struct device *can_dev = DEVICE_GET(can_mcux_flexcan_0);
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
|
||||
dev, dev->name, can_dev, can_dev->name);
|
||||
|
|
|
@ -91,7 +91,7 @@ static inline void can_set_lladdr(struct net_pkt *pkt, struct zcan_frame *frame)
|
|||
static int net_can_send(struct device *dev, const struct zcan_frame *frame,
|
||||
can_tx_callback_t cb, void *cb_arg, k_timeout_t timeout)
|
||||
{
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
NET_ASSERT(frame->id_type == CAN_EXTENDED_IDENTIFIER);
|
||||
return can_send(ctx->can_dev, frame, timeout, cb, cb_arg);
|
||||
|
@ -173,7 +173,7 @@ static void mcast_cb(struct net_if *iface, const struct in6_addr *addr,
|
|||
bool is_joined)
|
||||
{
|
||||
struct device *dev = net_if_get_device(iface);
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
struct mcast_filter_mapping *filter_mapping;
|
||||
int filter_id;
|
||||
|
||||
|
@ -206,7 +206,7 @@ static void mcast_cb(struct net_if *iface, const struct in6_addr *addr,
|
|||
static void net_can_iface_init(struct net_if *iface)
|
||||
{
|
||||
struct device *dev = net_if_get_device(iface);
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
ctx->iface = iface;
|
||||
|
||||
|
@ -221,14 +221,14 @@ static int can_attach_filter(struct device *dev, can_rx_callback_t cb,
|
|||
void *cb_arg,
|
||||
const struct zcan_filter *filter)
|
||||
{
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
return can_attach_isr(ctx->can_dev, cb, cb_arg, filter);
|
||||
}
|
||||
|
||||
static void can_detach_filter(struct device *dev, int filter_id)
|
||||
{
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
if (filter_id >= 0) {
|
||||
can_detach(ctx->can_dev, filter_id);
|
||||
|
@ -314,7 +314,7 @@ static inline int can_attach_all_mcast_filter(struct net_can_context *ctx)
|
|||
|
||||
static int can_enable(struct device *dev, bool enable)
|
||||
{
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
if (enable) {
|
||||
if (ctx->recv_filter_id == CAN_NET_FILTER_NOT_SET) {
|
||||
|
@ -373,7 +373,7 @@ static struct net_can_api net_can_api_inst = {
|
|||
static int net_can_init(struct device *dev)
|
||||
{
|
||||
struct device *can_dev;
|
||||
struct net_can_context *ctx = dev->driver_data;
|
||||
struct net_can_context *ctx = dev->data;
|
||||
|
||||
can_dev = device_get_binding(DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL);
|
||||
|
||||
|
|
|
@ -1106,7 +1106,7 @@ static void config_can_1_irq(CAN_TypeDef *can)
|
|||
static int socket_can_init_1(struct device *dev)
|
||||
{
|
||||
struct device *can_dev = DEVICE_GET(can_stm32_1);
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
|
||||
dev, dev->name, can_dev, can_dev->name);
|
||||
|
@ -1189,7 +1189,7 @@ static void config_can_2_irq(CAN_TypeDef *can)
|
|||
static int socket_can_init_2(struct device *dev)
|
||||
{
|
||||
struct device *can_dev = DEVICE_GET(can_stm32_2);
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
LOG_DBG("Init socket CAN device %p (%s) for dev %p (%s)",
|
||||
dev, dev->name, can_dev, can_dev->name);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include <drivers/can.h>
|
||||
|
||||
#define DEV_DATA(dev) ((struct can_stm32_data *const)(dev)->driver_data)
|
||||
#define DEV_DATA(dev) ((struct can_stm32_data *const)(dev)->data)
|
||||
#define DEV_CFG(dev) \
|
||||
((const struct can_stm32_config *const)(dev)->config)
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ struct socket_can_context {
|
|||
static inline void socket_can_iface_init(struct net_if *iface)
|
||||
{
|
||||
struct device *dev = net_if_get_device(iface);
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
socket_context->iface = iface;
|
||||
|
||||
|
@ -55,7 +55,7 @@ static inline void tx_irq_callback(uint32_t error_flags, void *arg)
|
|||
/* This is called by net_if.c when packet is about to be sent */
|
||||
static inline int socket_can_send(struct device *dev, struct net_pkt *pkt)
|
||||
{
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
int ret;
|
||||
|
||||
if (net_pkt_family(pkt) != AF_CAN) {
|
||||
|
@ -79,7 +79,7 @@ static inline int socket_can_setsockopt(struct device *dev, void *obj,
|
|||
int level, int optname,
|
||||
const void *optval, socklen_t optlen)
|
||||
{
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
struct net_context *ctx = obj;
|
||||
int ret;
|
||||
|
||||
|
@ -104,7 +104,7 @@ static inline int socket_can_setsockopt(struct device *dev, void *obj,
|
|||
|
||||
static inline void socket_can_close(struct device *dev, int filter_id)
|
||||
{
|
||||
struct socket_can_context *socket_context = dev->driver_data;
|
||||
struct socket_can_context *socket_context = dev->data;
|
||||
|
||||
can_detach(socket_context->can_dev, filter_id);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue