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
|
@ -25,7 +25,7 @@ LOG_MODULE_REGISTER(LSM9DS0_GYRO, CONFIG_SENSOR_LOG_LEVEL);
|
|||
static inline int lsm9ds0_gyro_power_ctrl(struct device *dev, int power,
|
||||
int x_en, int y_en, int z_en)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config;
|
||||
uint8_t state = (power << LSM9DS0_GYRO_SHIFT_CTRL_REG1_G_PD) |
|
||||
(x_en << LSM9DS0_GYRO_SHIFT_CTRL_REG1_G_XEN) |
|
||||
|
@ -43,7 +43,7 @@ static inline int lsm9ds0_gyro_power_ctrl(struct device *dev, int power,
|
|||
|
||||
static int lsm9ds0_gyro_set_fs_raw(struct device *dev, uint8_t fs)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config;
|
||||
|
||||
if (i2c_reg_update_byte(data->i2c_master, config->i2c_slave_addr,
|
||||
|
@ -84,7 +84,7 @@ static int lsm9ds0_gyro_set_fs(struct device *dev, int fs)
|
|||
|
||||
static inline int lsm9ds0_gyro_set_odr_raw(struct device *dev, uint8_t odr)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config;
|
||||
|
||||
return i2c_reg_update_byte(data->i2c_master, config->i2c_slave_addr,
|
||||
|
@ -121,7 +121,7 @@ static int lsm9ds0_gyro_set_odr(struct device *dev, int odr)
|
|||
static int lsm9ds0_gyro_sample_fetch(struct device *dev,
|
||||
enum sensor_channel chan)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config;
|
||||
uint8_t x_l, x_h, y_l, y_h, z_l, z_h;
|
||||
|
||||
|
@ -196,7 +196,7 @@ static int lsm9ds0_gyro_channel_get(struct device *dev,
|
|||
enum sensor_channel chan,
|
||||
struct sensor_value *val)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
|
||||
#if defined(CONFIG_LSM9DS0_GYRO_FULLSCALE_RUNTIME)
|
||||
switch (data->sample_fs) {
|
||||
|
@ -261,7 +261,7 @@ static const struct sensor_driver_api lsm9ds0_gyro_api_funcs = {
|
|||
|
||||
static int lsm9ds0_gyro_init_chip(struct device *dev)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config;
|
||||
uint8_t chip_id;
|
||||
|
||||
|
@ -318,7 +318,7 @@ err_poweroff:
|
|||
static int lsm9ds0_gyro_init(struct device *dev)
|
||||
{
|
||||
const struct lsm9ds0_gyro_config * const config = dev->config;
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
|
||||
data->i2c_master = device_get_binding(config->i2c_master_dev_name);
|
||||
if (!data->i2c_master) {
|
||||
|
|
|
@ -23,7 +23,7 @@ LOG_MODULE_DECLARE(LSM9DS0_GYRO, CONFIG_SENSOR_LOG_LEVEL);
|
|||
static inline void setup_drdy(struct device *dev,
|
||||
bool enable)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config *cfg = dev->config;
|
||||
|
||||
gpio_pin_interrupt_configure(data->gpio_drdy,
|
||||
|
@ -37,7 +37,7 @@ int lsm9ds0_gyro_trigger_set(struct device *dev,
|
|||
const struct sensor_trigger *trig,
|
||||
sensor_trigger_handler_t handler)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
const struct lsm9ds0_gyro_config * const config =
|
||||
dev->config;
|
||||
uint8_t state;
|
||||
|
@ -84,7 +84,7 @@ static void lsm9ds0_gyro_gpio_drdy_callback(struct device *dev,
|
|||
static void lsm9ds0_gyro_thread_main(void *arg1, void *arg2, void *arg3)
|
||||
{
|
||||
struct device *dev = (struct device *) arg1;
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
|
||||
while (1) {
|
||||
k_sem_take(&data->sem, K_FOREVER);
|
||||
|
@ -101,7 +101,7 @@ int lsm9ds0_gyro_init_interrupt(struct device *dev)
|
|||
{
|
||||
const struct lsm9ds0_gyro_config * const config =
|
||||
dev->config;
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
struct lsm9ds0_gyro_data *data = dev->data;
|
||||
|
||||
k_sem_init(&data->sem, 0, UINT_MAX);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue