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

@ -21,7 +21,7 @@ LOG_MODULE_DECLARE(BMG160, CONFIG_SENSOR_LOG_LEVEL);
static inline void setup_int(struct device *dev,
bool enable)
{
struct bmg160_device_data *data = dev->driver_data;
struct bmg160_device_data *data = dev->data;
const struct bmg160_device_config *const cfg =
dev->config;
@ -51,7 +51,7 @@ static void bmg160_gpio_callback(struct device *port, struct gpio_callback *cb,
static int bmg160_anymotion_set(struct device *dev,
sensor_trigger_handler_t handler)
{
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
uint8_t anymotion_en = 0U;
if (handler) {
@ -72,7 +72,7 @@ static int bmg160_anymotion_set(struct device *dev,
static int bmg160_drdy_set(struct device *dev, sensor_trigger_handler_t handler)
{
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
if (bmg160_update_byte(dev, BMG160_REG_INT_EN0,
BMG160_DATA_EN,
@ -88,7 +88,7 @@ static int bmg160_drdy_set(struct device *dev, sensor_trigger_handler_t handler)
int bmg160_slope_config(struct device *dev, enum sensor_attribute attr,
const struct sensor_value *val)
{
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
if (attr == SENSOR_ATTR_SLOPE_TH) {
uint16_t any_th_dps, range_dps;
@ -135,7 +135,7 @@ int bmg160_trigger_set(struct device *dev,
static int bmg160_handle_anymotion_int(struct device *dev)
{
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
struct sensor_trigger any_trig = {
.type = SENSOR_TRIG_DELTA,
.chan = SENSOR_CHAN_GYRO_XYZ,
@ -150,7 +150,7 @@ static int bmg160_handle_anymotion_int(struct device *dev)
static int bmg160_handle_dataready_int(struct device *dev)
{
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
struct sensor_trigger drdy_trig = {
.type = SENSOR_TRIG_DATA_READY,
.chan = SENSOR_CHAN_GYRO_XYZ,
@ -186,7 +186,7 @@ static struct k_thread bmg160_thread;
static void bmg160_thread_main(void *arg1, void *arg2, void *arg3)
{
struct device *dev = (struct device *)arg1;
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
while (true) {
k_sem_take(&bmg160->trig_sem, K_FOREVER);
@ -209,7 +209,7 @@ static void bmg160_work_cb(struct k_work *work)
int bmg160_trigger_init(struct device *dev)
{
const struct bmg160_device_config *cfg = dev->config;
struct bmg160_device_data *bmg160 = dev->driver_data;
struct bmg160_device_data *bmg160 = dev->data;
/* set INT1 pin to: push-pull, active low */
if (bmg160_write_byte(dev, BMG160_REG_INT_EN1, 0) < 0) {