Skip to contentSkip to conversation

hw: edu: set category of the edu device

PATCH Applied kumar sourav 3 participants 3 messages Jan 24, 2019 – Jan 30, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw: edu: set category of the edu device

Sets the category of edu device as DEVICE_CATEGORY_MISC. Devices should be assigned to one of DEVICE_CATEGORY_XXXX.

---
 hw/misc/edu.c | 2 ++
 1 file changed, 2 insertions(+)
hw/misc/edu.c +2 -0
index ceaf688bfb..91af452c9e 100644
@@ -399,6 +399,7 @@ static void edu_instance_init(Object *obj)
 
 static void edu_class_init(ObjectClass *class, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(class);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(class);
 
     k->realize = pci_edu_realize;
@@ -407,6 +408,7 @@ static void edu_class_init(ObjectClass *class, void *data)
     k->device_id = 0x11e8;
     k->revision = 0x10;
     k->class_id = PCI_CLASS_OTHERS;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static void pci_edu_register_types(void)
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · kumar sourav

Sets the category of edu device as DEVICE_CATEGORY_MISC. Devices should be assigned to one of DEVICE_CATEGORY_XXXX.

---
 hw/misc/edu.c | 2 ++
 1 file changed, 2 insertions(+)
hw/misc/edu.c +1 -0
index ceaf688bfb..91af452c9e 100644
@@ -399,6 +399,7 @@ static void edu_instance_init(Object *obj)
 
 static void edu_class_init(ObjectClass *class, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(class);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(class);
 
     k->realize = pci_edu_realize;

hw/misc/edu.c static void edu_class_init(ObjectClass *class, void *data) · line 414

Quoted 7 lines
hw/misc/edu.c +1 -0
@@ -407,6 +408,7 @@ static void edu_class_init(ObjectClass *class, void *data)
     k->device_id = 0x11e8;
     k->revision = 0x10;
     k->class_id = PCI_CLASS_OTHERS;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static void pci_edu_register_types(void)

Looks fine.

#2 lore raw
In reply to kumar sourav
Quoted 22 lines · kumar sourav

Sets the category of edu device as DEVICE_CATEGORY_MISC. Devices should be assigned to one of DEVICE_CATEGORY_XXXX.

---
 hw/misc/edu.c | 2 ++
 1 file changed, 2 insertions(+)
hw/misc/edu.c +1 -0
index ceaf688bfb..91af452c9e 100644
@@ -399,6 +399,7 @@ static void edu_instance_init(Object *obj)
 
 static void edu_class_init(ObjectClass *class, void *data)
 {
+    DeviceClass *dc = DEVICE_CLASS(class);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(class);
 
     k->realize = pci_edu_realize;

hw/misc/edu.c static void edu_class_init(ObjectClass *class, void *data) · line 414

Quoted 7 lines
hw/misc/edu.c +1 -0
@@ -407,6 +408,7 @@ static void edu_class_init(ObjectClass *class, void *data)
     k->device_id = 0x11e8;
     k->revision = 0x10;
     k->class_id = PCI_CLASS_OTHERS;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static void pci_edu_register_types(void)

Applied to my trivial-patches branch.

Thanks,
Laurent