[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 2/9] hw/net/xilinx_axienet: Cleanup stream->push assignment
From: |
Edgar E. Iglesias |
Subject: |
[PATCH v1 2/9] hw/net/xilinx_axienet: Cleanup stream->push assignment |
Date: |
Thu, 30 Apr 2020 18:24:32 +0200 |
From: "Edgar E. Iglesias" <address@hidden>
Split the shared stream_class_init function to assign
stream->push with better type-safety.
Signed-off-by: Edgar E. Iglesias <address@hidden>
---
hw/net/xilinx_axienet.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
index 0f97510d8a..84073753d7 100644
--- a/hw/net/xilinx_axienet.c
+++ b/hw/net/xilinx_axienet.c
@@ -1029,11 +1029,19 @@ static void xilinx_enet_class_init(ObjectClass *klass,
void *data)
dc->reset = xilinx_axienet_reset;
}
-static void xilinx_enet_stream_class_init(ObjectClass *klass, void *data)
+static void xilinx_enet_control_stream_class_init(ObjectClass *klass,
+ void *data)
{
StreamSlaveClass *ssc = STREAM_SLAVE_CLASS(klass);
- ssc->push = data;
+ ssc->push = xilinx_axienet_control_stream_push;
+}
+
+static void xilinx_enet_data_stream_class_init(ObjectClass *klass, void *data)
+{
+ StreamSlaveClass *ssc = STREAM_SLAVE_CLASS(klass);
+
+ ssc->push = xilinx_axienet_data_stream_push;
}
static const TypeInfo xilinx_enet_info = {
@@ -1048,8 +1056,7 @@ static const TypeInfo xilinx_enet_data_stream_info = {
.name = TYPE_XILINX_AXI_ENET_DATA_STREAM,
.parent = TYPE_OBJECT,
.instance_size = sizeof(struct XilinxAXIEnetStreamSlave),
- .class_init = xilinx_enet_stream_class_init,
- .class_data = xilinx_axienet_data_stream_push,
+ .class_init = xilinx_enet_data_stream_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_STREAM_SLAVE },
{ }
@@ -1060,8 +1067,7 @@ static const TypeInfo xilinx_enet_control_stream_info = {
.name = TYPE_XILINX_AXI_ENET_CONTROL_STREAM,
.parent = TYPE_OBJECT,
.instance_size = sizeof(struct XilinxAXIEnetStreamSlave),
- .class_init = xilinx_enet_stream_class_init,
- .class_data = xilinx_axienet_control_stream_push,
+ .class_init = xilinx_enet_control_stream_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_STREAM_SLAVE },
{ }
--
2.20.1
- [PATCH v1 0/9] hw/core: stream: Add end-of-packet flag, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 2/9] hw/net/xilinx_axienet: Cleanup stream->push assignment,
Edgar E. Iglesias <=
- [PATCH v1 1/9] hw/net/xilinx_axienet: Auto-clear PHY Autoneg, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 4/9] hw/dma/xilinx_axidma: Add DMA memory-region property, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 3/9] hw/net/xilinx_axienet: Remove unncessary cast, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 5/9] hw/core: stream: Add an end-of-packet flag, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 6/9] hw/net/xilinx_axienet: Handle fragmented packets from DMA, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 7/9] hw/dma/xilinx_axidma: mm2s: Stream descriptor by descriptor, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 8/9] hw/dma/xilinx_axidma: s2mm: Support stream fragments, Edgar E. Iglesias, 2020/04/30
- [PATCH v1 9/9] MAINTAINERS: Add myself as streams maintainer, Edgar E. Iglesias, 2020/04/30