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:
Tomasz Bursztyka 2020-05-28 21:23:02 +02:00 committed by Carles Cufí
commit 98d9b01322
498 changed files with 2085 additions and 2087 deletions

View file

@ -30,7 +30,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
static int eth_enc28j60_soft_reset(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2] = { ENC28J60_SPI_SC, 0xFF };
const struct spi_buf tx_buf = {
.buf = buf,
@ -46,7 +46,7 @@ static int eth_enc28j60_soft_reset(struct device *dev)
static void eth_enc28j60_set_bank(struct device *dev, uint16_t reg_addr)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -81,7 +81,7 @@ static void eth_enc28j60_set_bank(struct device *dev, uint16_t reg_addr)
static void eth_enc28j60_write_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -101,7 +101,7 @@ static void eth_enc28j60_write_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_read_reg(struct device *dev, uint16_t reg_addr,
uint8_t *value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[3];
const struct spi_buf tx_buf = {
.buf = buf,
@ -140,7 +140,7 @@ static void eth_enc28j60_read_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_set_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -161,7 +161,7 @@ static void eth_enc28j60_set_eth_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_clear_eth_reg(struct device *dev, uint16_t reg_addr,
uint8_t value)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[2];
const struct spi_buf tx_buf = {
.buf = buf,
@ -181,7 +181,7 @@ static void eth_enc28j60_clear_eth_reg(struct device *dev, uint16_t reg_addr,
static void eth_enc28j60_write_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[1] = { ENC28J60_SPI_WBM };
struct spi_buf tx_buf[2] = {
{
@ -223,7 +223,7 @@ static void eth_enc28j60_write_mem(struct device *dev, uint8_t *data_buffer,
static void eth_enc28j60_read_mem(struct device *dev, uint8_t *data_buffer,
uint16_t buf_len)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t buf[1] = { ENC28J60_SPI_RBM };
const struct spi_buf tx_buf = {
.buf = buf,
@ -350,7 +350,7 @@ static void eth_enc28j60_init_buffers(struct device *dev)
static void eth_enc28j60_init_mac(struct device *dev)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint8_t data_macon;
eth_enc28j60_set_bank(dev, ENC28J60_REG_MACON1);
@ -433,7 +433,7 @@ static struct net_if *get_iface(struct eth_enc28j60_runtime *ctx,
static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t tx_bufaddr = ENC28J60_TXSTART;
uint16_t len = net_pkt_get_len(pkt);
uint8_t per_packet_control;
@ -507,7 +507,7 @@ static int eth_enc28j60_tx(struct device *dev, struct net_pkt *pkt)
static int eth_enc28j60_rx(struct device *dev, uint16_t *vlan_tag)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t lengthfr;
uint8_t counter;
@ -659,7 +659,7 @@ done:
static void eth_enc28j60_rx_thread(struct device *dev)
{
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
uint16_t vlan_tag = NET_VLAN_TAG_UNSPEC;
uint8_t int_stat;
@ -691,7 +691,7 @@ static enum ethernet_hw_caps eth_enc28j60_get_capabilities(struct device *dev)
static void eth_enc28j60_iface_init(struct net_if *iface)
{
struct device *dev = net_if_get_device(iface);
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
net_if_set_link_addr(iface, context->mac_address,
sizeof(context->mac_address),
@ -718,7 +718,7 @@ static const struct ethernet_api api_funcs = {
static int eth_enc28j60_init(struct device *dev)
{
const struct eth_enc28j60_config *config = dev->config;
struct eth_enc28j60_runtime *context = dev->driver_data;
struct eth_enc28j60_runtime *context = dev->data;
/* SPI config */
context->spi_cfg.operation = SPI_WORD_SET(8);