device: rename SYS_GET_DEVICE_NAME/SYS_GET_DEVICE
Rename them to DEVICE_NAME_GET and DEVICE_GET to fit in the 'device' namespace. Change-Id: I407a7f284ed4d1c071961b46615eea859c2e825f Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
0303d8cab9
commit
2c1a95aee6
|
@ -96,7 +96,7 @@ Example
|
|||
#define MY_DEV_IRQ 24 /* device uses IRQ 24 */
|
||||
#define MY_DEV_PRIO 2 /* device uses interrupt priority 2 */
|
||||
/* argument passed to my_isr(), in this case a pointer to the device */
|
||||
#define MY_ISR_ARG SYS_GET_DEVICE(my_device)
|
||||
#define MY_ISR_ARG DEVICE_GET(my_device)
|
||||
#define MY_IRQ_FLAGS 0 /* IRQ flags. Unused on non-x86 */
|
||||
|
||||
void my_isr(void *arg)
|
||||
|
|
|
@ -540,11 +540,11 @@ DEVICE_DEFINE(adc_dw_0, &adc_info_dev_0, SECONDARY,
|
|||
static void adc_config_0_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_ADC_DW_0_RX_IRQ, CONFIG_ADC_DW_0_PRI, adc_dw_rx_isr,
|
||||
SYS_GET_DEVICE(adc_dw_0), 0);
|
||||
DEVICE_GET(adc_dw_0), 0);
|
||||
irq_enable(CONFIG_ADC_DW_0_RX_IRQ);
|
||||
|
||||
irq_connect(CONFIG_ADC_DW_0_ERR_IRQ, CONFIG_ADC_DW_0_PRI,
|
||||
adc_dw_err_isr, SYS_GET_DEVICE(adc_dw_0), 0);
|
||||
adc_dw_err_isr, DEVICE_GET(adc_dw_0), 0);
|
||||
irq_enable(CONFIG_ADC_DW_0_ERR_IRQ);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -218,6 +218,6 @@ static int dw_aio_cmp_config(struct device *dev)
|
|||
ARG_UNUSED(dev);
|
||||
|
||||
irq_connect(INT_AIO_CMP_IRQ, 0, dw_aio_cmp_isr,
|
||||
SYS_GET_DEVICE(dw_aio_cmp), 0);
|
||||
DEVICE_GET(dw_aio_cmp), 0);
|
||||
return DEV_OK;
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ static void eth_config_0_irq(struct device *port)
|
|||
#ifdef CONFIG_ETH_DW_0_IRQ_DIRECT
|
||||
ARG_UNUSED(shared_irq_dev);
|
||||
irq_connect(CONFIG_ETH_DW_0_IRQ, CONFIG_ETH_DW_0_PRI, eth_dw_isr,
|
||||
SYS_GET_DEVICE(eth_dw_0), 0);
|
||||
DEVICE_GET(eth_dw_0), 0);
|
||||
irq_enable(CONFIG_ETH_DW_0_IRQ);
|
||||
#elif defined(CONFIG_ETH_DW_0_IRQ_SHARED)
|
||||
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
|
||||
|
|
|
@ -479,7 +479,7 @@ void gpio_config_0_irq(struct device *port)
|
|||
#ifdef CONFIG_GPIO_DW_0_IRQ_DIRECT
|
||||
ARG_UNUSED(shared_irq_dev);
|
||||
irq_connect(CONFIG_GPIO_DW_0_IRQ, CONFIG_GPIO_DW_0_PRI, gpio_dw_isr,
|
||||
SYS_GET_DEVICE(gpio_dw_0), GPIO_DW_0_IRQ_FLAGS);
|
||||
DEVICE_GET(gpio_dw_0), GPIO_DW_0_IRQ_FLAGS);
|
||||
irq_enable(config->irq_num);
|
||||
#elif defined(CONFIG_GPIO_DW_0_IRQ_SHARED)
|
||||
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
|
||||
|
@ -555,7 +555,7 @@ void gpio_config_1_irq(struct device *port)
|
|||
#ifdef CONFIG_GPIO_DW_1_IRQ_DIRECT
|
||||
ARG_UNUSED(shared_irq_dev);
|
||||
irq_connect(CONFIG_GPIO_DW_1_IRQ, CONFIG_GPIO_DW_1_PRI, gpio_dw_isr,
|
||||
SYS_GET_DEVICE(gpio_dw_1), GPIO_DW_1_IRQ_FLAGS);
|
||||
DEVICE_GET(gpio_dw_1), GPIO_DW_1_IRQ_FLAGS);
|
||||
irq_enable(config->irq_num);
|
||||
#elif defined(CONFIG_GPIO_DW_1_IRQ_SHARED)
|
||||
shared_irq_dev = device_get_binding(config->shared_irq_dev_name);
|
||||
|
|
|
@ -788,7 +788,7 @@ void i2c_config_0(struct device *port)
|
|||
#if defined(CONFIG_I2C_DW_0_IRQ_DIRECT)
|
||||
ARG_UNUSED(shared_irq_dev);
|
||||
irq_connect(CONFIG_I2C_DW_0_IRQ, CONFIG_I2C_DW_0_INT_PRIORITY,
|
||||
i2c_dw_isr, SYS_GET_DEVICE(i2c_0), I2C_DW_IRQ_FLAGS);
|
||||
i2c_dw_isr, DEVICE_GET(i2c_0), I2C_DW_IRQ_FLAGS);
|
||||
irq_enable(config->irq_num);
|
||||
#elif defined(CONFIG_I2C_DW_0_IRQ_SHARED)
|
||||
ARG_UNUSED(config);
|
||||
|
@ -841,7 +841,7 @@ void i2c_config_1(struct device *port)
|
|||
|
||||
ARG_UNUSED(shared_irq_dev);
|
||||
irq_connect(CONFIG_I2C_DW_1_IRQ, CONFIG_I2C_DW_1_INT_PRIORITY,
|
||||
i2c_dw_isr, SYS_GET_DEVICE(i2c_1), I2C_DW_IRQ_FLAGS);
|
||||
i2c_dw_isr, DEVICE_GET(i2c_1), I2C_DW_IRQ_FLAGS);
|
||||
irq_enable(config->irq_num);
|
||||
}
|
||||
|
||||
|
|
|
@ -691,13 +691,13 @@ void _i2c_qse_ss_config_irq_0(struct device *port)
|
|||
|
||||
/* Connect the IRQs to ISR */
|
||||
irq_connect(I2C_SS_0_ERR_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_0), 0);
|
||||
DEVICE_GET(i2c_ss_0), 0);
|
||||
irq_connect(I2C_SS_0_RX_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_0), 0);
|
||||
DEVICE_GET(i2c_ss_0), 0);
|
||||
irq_connect(I2C_SS_0_TX_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_0), 0);
|
||||
DEVICE_GET(i2c_ss_0), 0);
|
||||
irq_connect(I2C_SS_0_STOP_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_0), 0);
|
||||
DEVICE_GET(i2c_ss_0), 0);
|
||||
|
||||
irq_enable(I2C_SS_0_ERR_VECTOR);
|
||||
irq_enable(I2C_SS_0_RX_VECTOR);
|
||||
|
@ -757,13 +757,13 @@ void _i2c_qse_ss_config_irq_1(struct device *port)
|
|||
|
||||
/* Connect the IRQs to ISR */
|
||||
irq_connect(I2C_SS_1_ERR_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_1), 0);
|
||||
DEVICE_GET(i2c_ss_1), 0);
|
||||
irq_connect(I2C_SS_1_RX_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_1), 0);
|
||||
DEVICE_GET(i2c_ss_1), 0);
|
||||
irq_connect(I2C_SS_1_TX_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_1), 0);
|
||||
DEVICE_GET(i2c_ss_1), 0);
|
||||
irq_connect(I2C_SS_1_STOP_VECTOR, 1, i2c_qse_ss_isr,
|
||||
SYS_GET_DEVICE(i2c_ss_1), 0);
|
||||
DEVICE_GET(i2c_ss_1), 0);
|
||||
|
||||
irq_enable(I2C_SS_1_ERR_VECTOR);
|
||||
irq_enable(I2C_SS_1_RX_VECTOR);
|
||||
|
|
|
@ -209,7 +209,7 @@ DEVICE_DEFINE(rtc, &rtc_runtime, SECONDARY,
|
|||
int rtc_dw_init(struct device *dev)
|
||||
{
|
||||
irq_connect(CONFIG_RTC_IRQ, CONFIG_RTC_IRQ_PRI, rtc_dw_isr,
|
||||
SYS_GET_DEVICE(rtc), 0);
|
||||
DEVICE_GET(rtc), 0);
|
||||
irq_enable(CONFIG_RTC_IRQ);
|
||||
|
||||
_rtc_dw_int_unmask();
|
||||
|
|
|
@ -98,4 +98,4 @@ DEVICE_INIT_CONFIG_DEFINE(rtc, CONFIG_RTC_DRV_NAME,
|
|||
DEVICE_DEFINE(rtc, NULL, SECONDARY,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
||||
|
||||
static struct device *rtc_qmsi_dev = SYS_GET_DEVICE(rtc);
|
||||
static struct device *rtc_qmsi_dev = DEVICE_GET(rtc);
|
||||
|
|
|
@ -168,7 +168,7 @@ DEVICE_DEFINE(shared_irq_0, &shared_irq_0_runtime, SECONDARY,
|
|||
void shared_irq_config_0_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_SHARED_IRQ_0_IRQ, CONFIG_SHARED_IRQ_0_PRI,
|
||||
shared_irq_isr, SYS_GET_DEVICE(shared_irq_0),
|
||||
shared_irq_isr, DEVICE_GET(shared_irq_0),
|
||||
SHARED_IRQ_0_FLAGS);
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ DEVICE_DEFINE(shared_irq_1, &shared_irq_1_runtime, SECONDARY,
|
|||
void shared_irq_config_1_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_SHARED_IRQ_1_IRQ, CONFIG_SHARED_IRQ_1_PRI,
|
||||
shared_irq_isr, SYS_GET_DEVICE(shared_irq_1),
|
||||
shared_irq_isr, DEVICE_GET(shared_irq_1),
|
||||
SHARED_IRQ_1_FLAGS);
|
||||
}
|
||||
|
||||
|
|
|
@ -591,7 +591,7 @@ DEVICE_DEFINE(spi_dw_port_0, &spi_dw_data_port_0, SECONDARY,
|
|||
void spi_config_0_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_SPI_DW_PORT_0_IRQ, CONFIG_SPI_DW_PORT_0_PRI,
|
||||
spi_dw_isr, SYS_GET_DEVICE(spi_dw_port_0),
|
||||
spi_dw_isr, DEVICE_GET(spi_dw_port_0),
|
||||
SPI_DW_IRQ_FLAGS);
|
||||
irq_enable(CONFIG_SPI_DW_PORT_0_IRQ);
|
||||
}
|
||||
|
@ -624,7 +624,7 @@ DEVICE_DEFINE(spi_dw_port_1, &spi_dw_data_port_1, SECONDARY,
|
|||
void spi_config_1_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_SPI_DW_PORT_1_IRQ, CONFIG_SPI_DW_PORT_1_PRI,
|
||||
spi_dw_isr, SYS_GET_DEVICE(spi_dw_port_1),
|
||||
spi_dw_isr, DEVICE_GET(spi_dw_port_1),
|
||||
SPI_DW_IRQ_FLAGS);
|
||||
irq_enable(CONFIG_SPI_DW_PORT_1_IRQ);
|
||||
}
|
||||
|
|
|
@ -477,7 +477,7 @@ DEVICE_DEFINE(spi_intel_port_0, &spi_intel_data_port_0, SECONDARY,
|
|||
void spi_config_0_irq(void)
|
||||
{
|
||||
irq_connect(CONFIG_SPI_INTEL_PORT_0_IRQ, CONFIG_SPI_INTEL_PORT_0_PRI,
|
||||
spi_intel_isr, SYS_GET_DEVICE(spi_intel_port_0),
|
||||
spi_intel_isr, DEVICE_GET(spi_intel_port_0),
|
||||
SPI_INTEL_IRQ_FLAGS);
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ DEVICE_DEFINE(spi_intel_port_1, &spi_intel_data_port_1, SECONDARY,
|
|||
void spi_config_1_irq(void);
|
||||
{
|
||||
irq_connect(CONFIG_SPI_INTEL_PORT_1_IRQ, CONFIG_SPI_INTEL_PORT_1_PRI,
|
||||
spi_intel_isr, SYS_GET_DEVICE(spi_intel_port_1),
|
||||
spi_intel_isr, DEVICE_GET(spi_intel_port_1),
|
||||
SPI_INTEL_IRQ_FLAGS);
|
||||
}
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ int wdt_dw_init(struct device *dev)
|
|||
dev->driver_api = &wdt_dw_funcs;
|
||||
|
||||
irq_connect(CONFIG_WDT_DW_IRQ, CONFIG_WDT_DW_IRQ_PRI, wdt_dw_isr,
|
||||
SYS_GET_DEVICE(wdt), 0);
|
||||
DEVICE_GET(wdt), 0);
|
||||
irq_enable(CONFIG_WDT_DW_IRQ);
|
||||
|
||||
_wdt_dw_int_unmask();
|
||||
|
|
|
@ -106,7 +106,7 @@ DEVICE_DEFINE(wdt, 0, PRIMARY, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
|
|||
* is not used by the ISR code, we require it in order to be able to pass
|
||||
* the device argument from the user callback (wdt_config->interrupt_fn).
|
||||
*/
|
||||
struct device *wdt_qmsi_isr_dev = SYS_GET_DEVICE(wdt);
|
||||
struct device *wdt_qmsi_isr_dev = DEVICE_GET(wdt);
|
||||
|
||||
static void interrupt_callback(void)
|
||||
{
|
||||
|
|
|
@ -90,7 +90,7 @@ extern "C" {
|
|||
.driver_data = data}
|
||||
|
||||
/**
|
||||
* @def SYS_GET_DEVICE_NAME
|
||||
* @def DEVICE_NAME_GET
|
||||
*
|
||||
* @brief Expands to the full name of a global device object
|
||||
*
|
||||
|
@ -98,16 +98,16 @@ extern "C" {
|
|||
* DEVICE_DEFINE(), using the @name provided to DEVICE_DEFINE().
|
||||
*
|
||||
* It is meant to be used for declaring extern symbols pointing on device
|
||||
* objects before using the SYS_GET_DEVICE macro to get the device object.
|
||||
* objects before using the DEVICE_GET macro to get the device object.
|
||||
*
|
||||
* @param name The same name provided to DEVICE_DEFINE()
|
||||
*
|
||||
* @return The exanded name of the device object created by DEVICE_DEFINE()
|
||||
*/
|
||||
#define SYS_GET_DEVICE_NAME(name) (_CONCAT(__initconfig_, name))
|
||||
#define DEVICE_NAME_GET(name) (_CONCAT(__initconfig_, name))
|
||||
|
||||
/**
|
||||
* @def SYS_GET_DEVICE
|
||||
* @def DEVICE_GET
|
||||
*
|
||||
* @brief Obtain a pointer to a device object by name
|
||||
*
|
||||
|
@ -118,7 +118,7 @@ extern "C" {
|
|||
*
|
||||
* @return A pointer to the device object created by DEVICE_DEFINE()
|
||||
*/
|
||||
#define SYS_GET_DEVICE(name) (&SYS_GET_DEVICE_NAME(name))
|
||||
#define DEVICE_GET(name) (&DEVICE_NAME_GET(name))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue