summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-11-29 07:47:47 +0000
committerbernard.xiong <[email protected]>2010-11-29 07:47:47 +0000
commit5a4d618832c0cb817bc4cf8a0e3d753bda628355 (patch)
tree2e880e17886a10665a6abc88c158ac112518debf
parent7a80d831c961d5c116fba457d3783459bbf41b6e (diff)
rename the private field in device to user_data.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1133 bbd45198-f89e-11dd-88c7-29a3b14d5316
-rw-r--r--libcpu/arm/lm3s/serial.c4
-rw-r--r--libcpu/arm/lpc214x/serial.c2
-rw-r--r--libcpu/arm/lpc24xx/serial.c4
-rw-r--r--libcpu/arm/s3c24x0/rtc.c2
-rw-r--r--libcpu/arm/s3c24x0/serial.c10
-rw-r--r--libcpu/arm/sep4020/serial.c10
-rw-r--r--libcpu/arm/stm32/serial.c14
-rw-r--r--libcpu/avr32/uc3/serial.c12
8 files changed, 29 insertions, 29 deletions
diff --git a/libcpu/arm/lm3s/serial.c b/libcpu/arm/lm3s/serial.c
index 4dd2bf306d..b52f806581 100644
--- a/libcpu/arm/lm3s/serial.c
+++ b/libcpu/arm/lm3s/serial.c
@@ -329,7 +329,7 @@ void rt_hw_serial_init(void)
serial->parent.read = rt_serial_read;
serial->parent.write = rt_serial_write;
serial->parent.control = rt_serial_control;
- serial->parent.private = RT_NULL;
+ serial->parent.user_data = RT_NULL;
rt_device_register(&serial->parent,
"uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
@@ -352,7 +352,7 @@ void rt_hw_serial_init(void)
serial->parent.read = rt_serial_read;
serial->parent.write = rt_serial_write;
serial->parent.control = rt_serial_control;
- serial->parent.private = RT_NULL;
+ serial->parent.user_data = RT_NULL;
rt_device_register(&serial->parent,
"uart2", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
diff --git a/libcpu/arm/lpc214x/serial.c b/libcpu/arm/lpc214x/serial.c
index 4bfa7614e9..d616fad8b4 100644
--- a/libcpu/arm/lpc214x/serial.c
+++ b/libcpu/arm/lpc214x/serial.c
@@ -377,7 +377,7 @@ void rt_hw_serial_init(void)
lpc_serial->parent.read = rt_serial_read;
lpc_serial->parent.write = rt_serial_write;
lpc_serial->parent.control = rt_serial_control;
- lpc_serial->parent.private = RT_NULL;
+ lpc_serial->parent.user_data = RT_NULL;
rt_device_register(&lpc_serial->parent,
"uart2", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
diff --git a/libcpu/arm/lpc24xx/serial.c b/libcpu/arm/lpc24xx/serial.c
index 720099252b..161717aae5 100644
--- a/libcpu/arm/lpc24xx/serial.c
+++ b/libcpu/arm/lpc24xx/serial.c
@@ -340,7 +340,7 @@ void rt_hw_serial_init(void)
lpc_serial->parent.read = rt_serial_read;
lpc_serial->parent.write = rt_serial_write;
lpc_serial->parent.control = rt_serial_control;
- lpc_serial->parent.private = RT_NULL;
+ lpc_serial->parent.user_data = RT_NULL;
rt_device_register(&lpc_serial->parent,
"uart1", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
@@ -377,7 +377,7 @@ void rt_hw_serial_init(void)
lpc_serial->parent.read = rt_serial_read;
lpc_serial->parent.write = rt_serial_write;
lpc_serial->parent.control = rt_serial_control;
- lpc_serial->parent.private = RT_NULL;
+ lpc_serial->parent.user_data = RT_NULL;
rt_device_register(&lpc_serial->parent,
"uart2", RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX);
diff --git a/libcpu/arm/s3c24x0/rtc.c b/libcpu/arm/s3c24x0/rtc.c
index 86215f5b26..065d0e9298 100644
--- a/libcpu/arm/s3c24x0/rtc.c
+++ b/libcpu/arm/s3c24x0/rtc.c
@@ -165,7 +165,7 @@ void rt_hw_rtc_init(void)
rtc.control = rtc_control;
/* no private */
- rtc.private = RT_NULL;
+ rtc.user_data = RT_NULL;
rt_device_register(&rtc, "rtc", RT_DEVICE_FLAG_RDWR);
}
diff --git a/libcpu/arm/s3c24x0/serial.c b/libcpu/arm/s3c24x0/serial.c
index 688f23c9f9..1e851c1ec5 100644
--- a/libcpu/arm/s3c24x0/serial.c
+++ b/libcpu/arm/s3c24x0/serial.c
@@ -28,7 +28,7 @@
*/
static rt_err_t rt_serial_init (rt_device_t dev)
{
- struct serial_device* uart = (struct serial_device*) dev->private;
+ struct serial_device* uart = (struct serial_device*) dev->user_data;
if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED))
{
@@ -100,7 +100,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt
ptr = buffer;
err_code = RT_EOK;
- uart = (struct serial_device*)dev->private;
+ uart = (struct serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{
@@ -158,7 +158,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf
err_code = RT_EOK;
ptr = (rt_uint8_t*)buffer;
- uart = (struct serial_device*)dev->private;
+ uart = (struct serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_TX)
{
@@ -246,7 +246,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
device->read = rt_serial_read;
device->write = rt_serial_write;
device->control = rt_serial_control;
- device->private = serial;
+ device->user_data = serial;
/* register a character device */
return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag);
@@ -255,7 +255,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
/* ISR for serial interrupt */
void rt_hw_serial_isr(rt_device_t device)
{
- struct serial_device* uart = (struct serial_device*) device->private;
+ struct serial_device* uart = (struct serial_device*) device->user_data;
/* interrupt mode receive */
RT_ASSERT(device->flag & RT_DEVICE_FLAG_INT_RX);
diff --git a/libcpu/arm/sep4020/serial.c b/libcpu/arm/sep4020/serial.c
index 7f50348335..f2c36b3e05 100644
--- a/libcpu/arm/sep4020/serial.c
+++ b/libcpu/arm/sep4020/serial.c
@@ -26,7 +26,7 @@
/* RT-Thread Device Interface */
static rt_err_t rt_serial_init (rt_device_t dev)
{
- struct serial_device* uart = (struct serial_device*) dev->private;
+ struct serial_device* uart = (struct serial_device*) dev->user_data;
if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED))
{
@@ -69,7 +69,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt
ptr = buffer;
err_code = RT_EOK;
- uart = (struct serial_device*)dev->private;
+ uart = (struct serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{
@@ -133,7 +133,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf
err_code = RT_EOK;
ptr = (rt_uint8_t*)buffer;
- uart = (struct serial_device*)dev->private;
+ uart = (struct serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_TX)
{
@@ -225,7 +225,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
device->read = rt_serial_read;
device->write = rt_serial_write;
device->control = rt_serial_control;
- device->private = serial;
+ device->user_data = serial;
/* register a character device */
return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag);
@@ -235,7 +235,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
void rt_hw_serial_isr(rt_device_t device)
{
rt_base_t level;
- struct serial_device* uart = (struct serial_device*) device->private;
+ struct serial_device* uart = (struct serial_device*) device->user_data;
/* interrupt mode receive */
RT_ASSERT(device->flag & RT_DEVICE_FLAG_INT_RX);
diff --git a/libcpu/arm/stm32/serial.c b/libcpu/arm/stm32/serial.c
index 064184836a..13bf961e20 100644
--- a/libcpu/arm/stm32/serial.c
+++ b/libcpu/arm/stm32/serial.c
@@ -30,7 +30,7 @@ static void rt_serial_enable_dma(DMA_Channel_TypeDef* dma_channel,
/* RT-Thread Device Interface */
static rt_err_t rt_serial_init (rt_device_t dev)
{
- struct stm32_serial_device* uart = (struct stm32_serial_device*) dev->private;
+ struct stm32_serial_device* uart = (struct stm32_serial_device*) dev->user_data;
if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED))
{
@@ -81,7 +81,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt
ptr = buffer;
err_code = RT_EOK;
- uart = (struct stm32_serial_device*)dev->private;
+ uart = (struct stm32_serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{
@@ -161,7 +161,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf
err_code = RT_EOK;
ptr = (rt_uint8_t*)buffer;
- uart = (struct stm32_serial_device*)dev->private;
+ uart = (struct stm32_serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_TX)
{
@@ -259,7 +259,7 @@ static rt_err_t rt_serial_control (rt_device_t dev, rt_uint8_t cmd, void *args)
RT_ASSERT(dev != RT_NULL);
- uart = (struct stm32_serial_device*)dev->private;
+ uart = (struct stm32_serial_device*)dev->user_data;
switch (cmd)
{
case RT_DEVICE_CTRL_SUSPEND:
@@ -301,7 +301,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
device->read = rt_serial_read;
device->write = rt_serial_write;
device->control = rt_serial_control;
- device->private = serial;
+ device->user_data = serial;
/* register a character device */
return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag);
@@ -310,7 +310,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
/* ISR for serial interrupt */
void rt_hw_serial_isr(rt_device_t device)
{
- struct stm32_serial_device* uart = (struct stm32_serial_device*) device->private;
+ struct stm32_serial_device* uart = (struct stm32_serial_device*) device->user_data;
if(USART_GetITStatus(uart->uart_device, USART_IT_RXNE) != RESET)
{
@@ -374,7 +374,7 @@ void rt_hw_serial_dma_tx_isr(rt_device_t device)
{
rt_uint32_t level;
struct stm32_serial_data_node* data_node;
- struct stm32_serial_device* uart = (struct stm32_serial_device*) device->private;
+ struct stm32_serial_device* uart = (struct stm32_serial_device*) device->user_data;
/* DMA mode receive */
RT_ASSERT(device->flag & RT_DEVICE_FLAG_DMA_TX);
diff --git a/libcpu/avr32/uc3/serial.c b/libcpu/avr32/uc3/serial.c
index 15431e20f4..da5aa868f8 100644
--- a/libcpu/avr32/uc3/serial.c
+++ b/libcpu/avr32/uc3/serial.c
@@ -37,7 +37,7 @@ struct avr32_serial_device uart =
/* RT-Thread Device Interface */
static rt_err_t rt_serial_init (rt_device_t dev)
{
- struct avr32_serial_device* uart = (struct avr32_serial_device*) dev->private;
+ struct avr32_serial_device* uart = (struct avr32_serial_device*) dev->user_data;
if (!(dev->flag & RT_DEVICE_FLAG_ACTIVATED))
{
@@ -72,7 +72,7 @@ static rt_size_t rt_serial_read (rt_device_t dev, rt_off_t pos, void* buffer, rt
ptr = buffer;
err_code = RT_EOK;
- uart = (struct avr32_serial_device*)dev->private;
+ uart = (struct avr32_serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_RX)
{
@@ -135,7 +135,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf
err_code = RT_EOK;
ptr = (rt_uint8_t*)buffer;
- uart = (struct avr32_serial_device*)dev->private;
+ uart = (struct avr32_serial_device*)dev->user_data;
if (dev->flag & RT_DEVICE_FLAG_INT_TX)
{
@@ -179,7 +179,7 @@ static rt_err_t rt_serial_control (rt_device_t dev, rt_uint8_t cmd, void *args)
RT_ASSERT(dev != RT_NULL);
- uart = (struct avr32_serial_device*)dev->private;
+ uart = (struct avr32_serial_device*)dev->user_data;
switch (cmd)
{
case RT_DEVICE_CTRL_SUSPEND:
@@ -219,7 +219,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
device->read = rt_serial_read;
device->write = rt_serial_write;
device->control = rt_serial_control;
- device->private = serial;
+ device->user_data = serial;
/* register a character device */
return rt_device_register(device, name, RT_DEVICE_FLAG_RDWR | flag);
@@ -228,7 +228,7 @@ rt_err_t rt_hw_serial_register(rt_device_t device, const char* name, rt_uint32_t
/* ISR for serial interrupt */
void rt_hw_serial_isr(void)
{
- struct avr32_serial_device* uart = (struct avr32_serial_device*) _rt_usart_device.private;
+ struct avr32_serial_device* uart = (struct avr32_serial_device*) _rt_usart_device.user_data;
rt_base_t level;
if (usart_test_hit(uart->uart_device))