@@ -129,6 +129,16 @@ static void dwc3_imx8mp_wakeup_disable(struct dwc3_imx8mp *dwc3_imx)
129129 writel (val , dwc3_imx -> hsio_blk_base + USB_WAKEUP_CTRL );
130130}
131131
132+ static const struct property_entry dwc3_imx8mp_properties [] = {
133+ PROPERTY_ENTRY_BOOL ("xhci-missing-cas-quirk" ),
134+ PROPERTY_ENTRY_BOOL ("xhci-skip-phy-init-quirk" ),
135+ {},
136+ };
137+
138+ static const struct software_node dwc3_imx8mp_swnode = {
139+ .properties = dwc3_imx8mp_properties ,
140+ };
141+
132142static irqreturn_t dwc3_imx8mp_interrupt (int irq , void * _dwc3_imx )
133143{
134144 struct dwc3_imx8mp * dwc3_imx = _dwc3_imx ;
@@ -148,17 +158,6 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx)
148158 return IRQ_HANDLED ;
149159}
150160
151- static int dwc3_imx8mp_set_software_node (struct device * dev )
152- {
153- struct property_entry props [3 ] = { 0 };
154- int prop_idx = 0 ;
155-
156- props [prop_idx ++ ] = PROPERTY_ENTRY_BOOL ("xhci-missing-cas-quirk" );
157- props [prop_idx ++ ] = PROPERTY_ENTRY_BOOL ("xhci-skip-phy-init-quirk" );
158-
159- return device_create_managed_software_node (dev , props , NULL );
160- }
161-
162161static int dwc3_imx8mp_probe (struct platform_device * pdev )
163162{
164163 struct device * dev = & pdev -> dev ;
@@ -221,17 +220,17 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
221220 if (err < 0 )
222221 goto disable_rpm ;
223222
224- err = dwc3_imx8mp_set_software_node (dev );
223+ err = device_add_software_node (dev , & dwc3_imx8mp_swnode );
225224 if (err ) {
226225 err = - ENODEV ;
227- dev_err (dev , "failed to create software node\n" );
226+ dev_err (dev , "failed to add software node\n" );
228227 goto disable_rpm ;
229228 }
230229
231230 err = of_platform_populate (node , NULL , NULL , dev );
232231 if (err ) {
233232 dev_err (& pdev -> dev , "failed to create dwc3 core\n" );
234- goto disable_rpm ;
233+ goto remove_swnode ;
235234 }
236235
237236 dwc3_imx -> dwc3 = of_find_device_by_node (dwc3_np );
@@ -255,6 +254,8 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
255254
256255depopulate :
257256 of_platform_depopulate (dev );
257+ remove_swnode :
258+ device_remove_software_node (dev );
258259disable_rpm :
259260 pm_runtime_disable (dev );
260261 pm_runtime_put_noidle (dev );
@@ -268,6 +269,7 @@ static void dwc3_imx8mp_remove(struct platform_device *pdev)
268269
269270 pm_runtime_get_sync (dev );
270271 of_platform_depopulate (dev );
272+ device_remove_software_node (dev );
271273
272274 pm_runtime_disable (dev );
273275 pm_runtime_put_noidle (dev );
0 commit comments