usb: dwc3: use proper initializers for property entries
Subsystems (2)
PATCH 1/1 usb: dwc3: use proper initializers for property entries
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
---
It would be good if this could go through Rafael's tree as it is needed for the rest of my software_node/property_entry rework patch series which I would love not to delay till 5.6.
Thanks!
drivers/usb/dwc3/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/host.c +3 -3
@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)memset (props,0 ,sizeof (struct property_entry ) *ARRAY_SIZE (props));if (dwc->usb3_lpm_capable) - props[prop_idx++].name ="usb3-lpm-capable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb3-lpm-capable" );if (dwc->usb2_lpm_disable) - props[prop_idx++].name ="usb2-lpm-disable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb2-lpm-disable" );/** * WORKAROUND: dwc3 revisions <=3.00a have a limitation
@@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)* This following flag tells XHCI to do just that. */ if (dwc->revision <=DWC3_REVISION_300A ) - props[prop_idx++].name ="quirk-broken-port-ped" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("quirk-broken-port-ped" );if (prop_idx) { ret =platform_device_add_properties (xhci, props);
Signature · 5 lines
2.24.1.735.g03f4e72817-goog -- Dmitry
Hi,
Quoted 5 lines · Dmitry Torokhov
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
Quoted 8 lines
Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
It would be good if this could go through Rafael's tree as it is needed for the rest of my software_node/property_entry rework patch series which I would love not to delay till 5.6.
Patch looks good to me:
Regards,
Hans
Quoted 33 lines
Thanks!
drivers/usb/dwc3/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/usb/dwc3/host.c +3
-3@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)memset (props,0 ,sizeof (struct property_entry ) *ARRAY_SIZE (props));if (dwc->usb3_lpm_capable) - props[prop_idx++].name ="usb3-lpm-capable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb3-lpm-capable" );if (dwc->usb2_lpm_disable) - props[prop_idx++].name ="usb2-lpm-disable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb2-lpm-disable" );/** * WORKAROUND: dwc3 revisions <=3.00a have a limitation @@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)* This following flag tells XHCI to do just that. */ if (dwc->revision <=DWC3_REVISION_300A ) - props[prop_idx++].name ="quirk-broken-port-ped" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("quirk-broken-port-ped" );if (prop_idx) { ret =platform_device_add_properties (xhci, props);
Hi All,
Quoted 13 lines · Hans de Goede
Hi,
Quoted 10 lines · Dmitry Torokhov
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
Quoted 7 lines
Quoted 3 lines
It would be good if this could go through Rafael's tree as it is needed for the rest of my software_node/property_entry rework patch series which I would love not to delay till 5.6.
Patch looks good to me:
Acked-by Hans de Goede <[email protected]>
This patch is instantly needed as the issue it fixes is again triggered in current (20200107) linux-next by commit e6bff4665c59 "software node:
replace is_array with is_inline".
Felipe: could You ack it, so it could be merged via Rafael's tree together with related device property changes?
Quoted 21 lines
Quoted 21 lines
drivers/usb/dwc3/host.c| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)drivers/usb/dwc3/host.c +0
-0@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)
memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
if (dwc->usb3_lpm_capable)
- props[prop_idx++].name = "usb3-lpm-capable";
+ props[prop_idx++] =PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); if (dwc->usb2_lpm_disable)
- props[prop_idx++].name = "usb2-lpm-disable";
+ props[prop_idx++] =PROPERTY_ENTRY_BOOL("usb2-lpm-disable"); /**
* WORKAROUND: dwc3 revisions <=3.00a have a limitationdrivers/usb/dwc3/host.c +0
-0@@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc) * This following flag tells XHCI to do just that.
Quoted 9 lines
drivers/usb/dwc3/host.c int dwc3_host_init(struct dwc3 *dwc) · line 109
Quoted 8 lines
drivers/usb/dwc3/host.c +1
-1*/ if (dwc->revision <= DWC3_REVISION_300A) - props[prop_idx++].name = "quirk-broken-port-ped"; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("quirk-broken-port-ped" ); if (prop_idx) { ret = platform_device_add_properties(xhci, props);
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Felipe Balbi
Acked-byHi,
Quoted 22 lines · Marek Szyprowski
Hi All,
Quoted 19 lines · Hans de Goede
Hi,
Quoted 5 lines · Dmitry Torokhov
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
Quoted 8 lines
Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
It would be good if this could go through Rafael's tree as it is needed for the rest of my software_node/property_entry rework patch series which I would love not to delay till 5.6.
Patch looks good to me:
Quoted 8 lines
Quoted 1 line
Acked-by Hans de Goede <[email protected]>This patch is instantly needed as the issue it fixes is again triggered in current (20200107) linux-next by commit
e6bff4665c59"software node:
replaceis_arraywithis_inline".Felipe: could You ack it, so it could be merged via Rafael's tree together with related device property changes?
Here you go:
cheers
Signature · 1 line
balbi
Rafael J. Wysocki
AppliedQuoted 34 lines · Felipe Balbi
Hi,
Quoted 28 lines · Marek Szyprowski
Hi All,
Quoted 13 lines · Hans de Goede
Hi,
Quoted 10 lines · Dmitry Torokhov
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
Reported-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Dmitry Torokhov <[email protected]>---
Quoted 7 lines
Quoted 3 lines
It would be good if this could go through Rafael's tree as it is needed for the rest of my software_node/property_entry rework patch series which I would love not to delay till 5.6.
Patch looks good to me:
Acked-by Hans de Goede <[email protected]>This patch is instantly needed as the issue it fixes is again triggered in current (20200107) linux-next by commit
e6bff4665c59"software node:
replaceis_arraywithis_inline".
Quoted 6 lines
Quoted 2 lines
Felipe: could You ack it, so it could be merged via Rafael's tree together with related device property changes?
Here you go:
Acked-by Felipe Balbi <[email protected]>
Thanks, applied.