device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix accessing config_info, name, ... attributes everywhere via: grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g' Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
8d7bb8ffd8
commit
97326c0445
348 changed files with 1155 additions and 1174 deletions
|
@ -26,7 +26,7 @@ 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;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config_info;
|
||||
u8_t state = (power << LSM9DS0_GYRO_SHIFT_CTRL_REG1_G_PD) |
|
||||
(x_en << LSM9DS0_GYRO_SHIFT_CTRL_REG1_G_XEN) |
|
||||
(y_en << LSM9DS0_GYRO_SHIFT_CTRL_REG1_G_YEN) |
|
||||
|
@ -44,7 +44,7 @@ static inline int lsm9ds0_gyro_power_ctrl(struct device *dev, int power,
|
|||
static int lsm9ds0_gyro_set_fs_raw(struct device *dev, u8_t fs)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config_info;
|
||||
|
||||
if (i2c_reg_update_byte(data->i2c_master, config->i2c_slave_addr,
|
||||
LSM9DS0_GYRO_REG_CTRL_REG4_G,
|
||||
|
@ -85,7 +85,7 @@ static int lsm9ds0_gyro_set_fs(struct device *dev, int fs)
|
|||
static inline int lsm9ds0_gyro_set_odr_raw(struct device *dev, u8_t odr)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config_info;
|
||||
|
||||
return i2c_reg_update_byte(data->i2c_master, config->i2c_slave_addr,
|
||||
LSM9DS0_GYRO_REG_CTRL_REG1_G,
|
||||
|
@ -122,7 +122,7 @@ static int lsm9ds0_gyro_sample_fetch(struct device *dev,
|
|||
enum sensor_channel chan)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config_info;
|
||||
u8_t x_l, x_h, y_l, y_h, z_l, z_h;
|
||||
|
||||
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL ||
|
||||
|
@ -262,7 +262,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;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *config = dev->config_info;
|
||||
u8_t chip_id;
|
||||
|
||||
if (lsm9ds0_gyro_power_ctrl(dev, 0, 0, 0, 0) < 0) {
|
||||
|
@ -318,7 +318,7 @@ err_poweroff:
|
|||
static int lsm9ds0_gyro_init(struct device *dev)
|
||||
{
|
||||
const struct lsm9ds0_gyro_config * const config =
|
||||
dev->config->config_info;
|
||||
dev->config_info;
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
|
||||
data->i2c_master = device_get_binding(config->i2c_master_dev_name);
|
||||
|
|
|
@ -24,7 +24,7 @@ static inline void setup_drdy(struct device *dev,
|
|||
bool enable)
|
||||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
const struct lsm9ds0_gyro_config *cfg = dev->config->config_info;
|
||||
const struct lsm9ds0_gyro_config *cfg = dev->config_info;
|
||||
|
||||
gpio_pin_interrupt_configure(data->gpio_drdy,
|
||||
cfg->gpio_drdy_int_pin,
|
||||
|
@ -39,7 +39,7 @@ int lsm9ds0_gyro_trigger_set(struct device *dev,
|
|||
{
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
const struct lsm9ds0_gyro_config * const config =
|
||||
dev->config->config_info;
|
||||
dev->config_info;
|
||||
u8_t state;
|
||||
|
||||
if (trig->type == SENSOR_TRIG_DATA_READY) {
|
||||
|
@ -100,7 +100,7 @@ static void lsm9ds0_gyro_thread_main(void *arg1, void *arg2, void *arg3)
|
|||
int lsm9ds0_gyro_init_interrupt(struct device *dev)
|
||||
{
|
||||
const struct lsm9ds0_gyro_config * const config =
|
||||
dev->config->config_info;
|
||||
dev->config_info;
|
||||
struct lsm9ds0_gyro_data *data = dev->driver_data;
|
||||
|
||||
k_sem_init(&data->sem, 0, UINT_MAX);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue