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>
diff --git a/drivers/dma/dma_dw.c b/drivers/dma/dma_dw.c
index caec057..5d0b9bc 100644
--- a/drivers/dma/dma_dw.c
+++ b/drivers/dma/dma_dw.c
@@ -34,10 +34,10 @@
/* default initial setup register values */
#define DW_CFG_LOW_DEF 0x0
-#define DEV_NAME(dev) ((dev)->config->name)
+#define DEV_NAME(dev) ((dev)->name)
#define DEV_DATA(dev) ((struct dw_dma_dev_data *const)(dev)->driver_data)
#define DEV_CFG(dev) \
- ((const struct dw_dma_dev_cfg *const)(dev)->config->config_info)
+ ((const struct dw_dma_dev_cfg *const)(dev)->config_info)
/* number of tries to wait for reset */
#define DW_DMA_CFG_TRIES 10000
diff --git a/drivers/dma/dma_nios2_msgdma.c b/drivers/dma/dma_nios2_msgdma.c
index 6e16422..3ee9fa3 100644
--- a/drivers/dma/dma_nios2_msgdma.c
+++ b/drivers/dma/dma_nios2_msgdma.c
@@ -30,9 +30,9 @@
int error_code);
};
-#define DEV_NAME(dev) ((dev)->config->name)
+#define DEV_NAME(dev) ((dev)->name)
#define DEV_CFG(dev) \
- ((struct nios2_msgdma_dev_cfg *)(dev)->config->config_info)
+ ((struct nios2_msgdma_dev_cfg *)(dev)->config_info)
static void nios2_msgdma_isr(void *arg)
{
diff --git a/drivers/dma/dma_sam_xdmac.c b/drivers/dma/dma_sam_xdmac.c
index 7e3ec6b..65ee8d1 100644
--- a/drivers/dma/dma_sam_xdmac.c
+++ b/drivers/dma/dma_sam_xdmac.c
@@ -45,9 +45,9 @@
struct sam_xdmac_channel_cfg dma_channels[DMA_CHANNELS_NO];
};
-#define DEV_NAME(dev) ((dev)->config->name)
+#define DEV_NAME(dev) ((dev)->name)
#define DEV_CFG(dev) \
- ((const struct sam_xdmac_dev_cfg *const)(dev)->config->config_info)
+ ((const struct sam_xdmac_dev_cfg *const)(dev)->config_info)
#define DEV_DATA(dev) \
((struct sam_xdmac_dev_data *const)(dev)->driver_data)
diff --git a/drivers/dma/dma_stm32.c b/drivers/dma/dma_stm32.c
index f473c9b..c92b691 100644
--- a/drivers/dma/dma_stm32.c
+++ b/drivers/dma/dma_stm32.c
@@ -38,7 +38,7 @@
static void dma_stm32_dump_stream_irq(struct device *dev, u32_t id)
{
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
stm32_dma_dump_stream_irq(dma, id);
@@ -46,7 +46,7 @@
static void dma_stm32_clear_stream_irq(struct device *dev, u32_t id)
{
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
func_ll_clear_tc[id](dma);
@@ -58,7 +58,7 @@
{
struct device *dev = arg;
struct dma_stm32_data *data = dev->driver_data;
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_stream *stream;
int id;
@@ -243,7 +243,7 @@
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
const struct dma_stm32_config *dev_config =
- dev->config->config_info;
+ dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)dev_config->base;
LL_DMA_InitTypeDef DMA_InitStruct;
u32_t msize;
@@ -275,7 +275,7 @@
if ((config->channel_direction == MEMORY_TO_MEMORY) &&
(!dev_config->support_m2m)) {
LOG_ERR("Memcopy not supported for device %s",
- dev->config->name);
+ dev->name);
return -ENOTSUP;
}
#endif /* CONFIG_DMA_STM32_V1 */
@@ -477,7 +477,7 @@
u32_t src, u32_t dst, size_t size)
#endif /* CONFIG_DMAMUX_STM32 */
{
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
@@ -524,7 +524,7 @@
static int dma_stm32_start(struct device *dev, u32_t id)
#endif /* CONFIG_DMAMUX_STM32 */
{
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
struct dma_stm32_data *data = dev->driver_data;
@@ -552,7 +552,7 @@
struct dma_stm32_data *data = dev->driver_data;
struct dma_stm32_stream *stream = &data->streams[id - STREAM_OFFSET];
const struct dma_stm32_config *config =
- dev->config->config_info;
+ dev->config_info;
DMA_TypeDef *dma = (DMA_TypeDef *)(config->base);
/* give channel from index 0 */
@@ -583,7 +583,7 @@
static int dma_stm32_init(struct device *dev)
{
struct dma_stm32_data *data = dev->driver_data;
- const struct dma_stm32_config *config = dev->config->config_info;
+ const struct dma_stm32_config *config = dev->config_info;
struct device *clk =
device_get_binding(STM32_CLOCK_CONTROL_NAME);
diff --git a/drivers/dma/dmamux_stm32.c b/drivers/dma/dmamux_stm32.c
index 3fabe53..4bdfbb6 100644
--- a/drivers/dma/dmamux_stm32.c
+++ b/drivers/dma/dmamux_stm32.c
@@ -31,7 +31,7 @@
/* device is the dmamux, id is the dmamux channel from 0 */
struct dmamux_stm32_data *data = dev->driver_data;
const struct dmamux_stm32_config *dev_config =
- dev->config->config_info;
+ dev->config_info;
/*
* request line ID for this mux channel is stored
@@ -79,7 +79,7 @@
int dmamux_stm32_start(struct device *dev, u32_t id)
{
const struct dmamux_stm32_config *dev_config =
- dev->config->config_info;
+ dev->config_info;
struct dmamux_stm32_data *data = dev->driver_data;
/* check if this channel is valid */
@@ -100,7 +100,7 @@
int dmamux_stm32_stop(struct device *dev, u32_t id)
{
const struct dmamux_stm32_config *dev_config =
- dev->config->config_info;
+ dev->config_info;
struct dmamux_stm32_data *data = dev->driver_data;
/* check if this channel is valid */
@@ -122,7 +122,7 @@
u32_t src, u32_t dst, size_t size)
{
const struct dmamux_stm32_config *dev_config =
- dev->config->config_info;
+ dev->config_info;
struct dmamux_stm32_data *data = dev->driver_data;
/* check if this channel is valid */
@@ -145,7 +145,7 @@
{
struct dmamux_stm32_data *data = dev->driver_data;
const struct dmamux_stm32_config *config =
- dev->config->config_info;
+ dev->config_info;
struct device *clk =
device_get_binding(STM32_CLOCK_CONTROL_NAME);