Skip to contentSkip to conversation

hw/arm/xlnx-zynqmp: Mark the "xlnx, zynqmp" device with user_creatable = false

PATCH Applied Thomas Huth 3 participants 6 messages Sep 26, 2017 – Oct 3, 2017 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm/xlnx-zynqmp: Mark the "xlnx, zynqmp" device with user_creatable = false

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

---
 hw/arm/xlnx-zynqmp.c | 2 ++
 1 file changed, 2 insertions(+)
hw/arm/xlnx-zynqmp.c +2 -0
index 2b27daf..d4b6560 100644
@@ -440,6 +440,8 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
 
     dc->props = xlnx_zynqmp_props;
     dc->realize = xlnx_zynqmp_realize;
+    /* Reason: Uses serial_hds in realize function, thus can't be used twice */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo xlnx_zynqmp_type_info = {
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thomas Huth

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

Is it worth changing the name now then as well?

Quoted 2 lines

Thanks,
Alistair

Quoted 21 lines
---
 hw/arm/xlnx-zynqmp.c | 2 ++
 1 file changed, 2 insertions(+)
hw/arm/xlnx-zynqmp.c +2 -1
index 2b27daf..d4b6560 100644
@@ -440,6 +440,8 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
 
     dc->props = xlnx_zynqmp_props;
     dc->realize = xlnx_zynqmp_realize;
+    /* Reason: Uses serial_hds in realize function, thus can't be used twice */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo xlnx_zynqmp_type_info = {
--

1.8.3.1

#2 lore raw
Quoted 8 lines · Alistair Francis
Quoted 5 lines · Thomas Huth

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

Is it worth changing the name now then as well?

Not sure, was there a reason for this name? E.g. is it used in a device tree somewhere somehow? Anyway, with user_creatable = false, I think it is not so urgent anymore to change it.

Quoted 3 lines
Quoted 1 line

Thanks!

Thomas

#3 lore raw
Quoted 8 lines · Thomas Huth
Quoted 7 lines · Alistair Francis
Quoted 5 lines · Thomas Huth

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

Quoted 5 lines
Quoted 1 line

Is it worth changing the name now then as well?

Not sure, was there a reason for this name? E.g. is it used in a device tree somewhere somehow? Anyway, with user_creatable = false, I think it is not so urgent anymore to change it.

I don't think there was a specific reason. Maybe it was copied from a device tree, but I'm not tied to keeping the comma. Maybe that's something we can investigate in the future.

Thanks,
Alistair

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

Thanks!

Thomas

#4 lore raw
Quoted 11 lines · Alistair Francis
Quoted 10 lines · Thomas Huth
Quoted 8 lines · Alistair Francis
Quoted 5 lines · Thomas Huth

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

Is it worth changing the name now then as well?

Quoted 7 lines
Quoted 3 lines

Not sure, was there a reason for this name? E.g. is it used in a device tree somewhere somehow? Anyway, with user_creatable = false, I think it is not so urgent anymore to change it.

I don't think there was a specific reason. Maybe it was copied from a device tree, but I'm not tied to keeping the comma. Maybe that's something we can investigate in the future.

I vaguely recall that the comma was part of an attempt to be consistent about device names by making them follow the device tree names for them rather than just making up our own. Some of the imx devices and boards follow the same convention.

thanks
-- PMM

#5 lore raw
In reply to Thomas Huth
Quoted 16 lines · Thomas Huth

The device uses serial_hds in its realize function and thus can't be used twice. Apart from that, the comma in its name makes it quite hard to use for the user anyway, since a comma is normally used to separate the device name from its properties when using the "-device" parameter or the "device_add" HMP command.

---
 hw/arm/xlnx-zynqmp.c | 2 ++
 1 file changed, 2 insertions(+)
hw/arm/xlnx-zynqmp.c +0 -0
index 2b27daf..d4b6560 100644

hw/arm/xlnx-zynqmp.c static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data) · line 447

Quoted 8 lines
hw/arm/xlnx-zynqmp.c +2 -0
@@ -440,6 +440,8 @@ static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
 
     dc->props = xlnx_zynqmp_props;
     dc->realize = xlnx_zynqmp_realize;
+    /* Reason: Uses serial_hds in realize function, thus can't be used twice */
+    dc->user_creatable = false;
 }
 
 static const TypeInfo xlnx_zynqmp_type_info = {

Applied to target-arm.next, thanks.

-- PMM