@@ -296,50 +296,44 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom)
296
296
icc_put (qcom -> icc_path_apps );
297
297
}
298
298
299
+ static void dwc3_qcom_enable_wakeup_irq (int irq )
300
+ {
301
+ if (!irq )
302
+ return ;
303
+
304
+ enable_irq (irq );
305
+ enable_irq_wake (irq );
306
+ }
307
+
308
+ static void dwc3_qcom_disable_wakeup_irq (int irq )
309
+ {
310
+ if (!irq )
311
+ return ;
312
+
313
+ disable_irq_wake (irq );
314
+ disable_irq_nosync (irq );
315
+ }
316
+
299
317
static void dwc3_qcom_disable_interrupts (struct dwc3_qcom * qcom )
300
318
{
301
- if (qcom -> hs_phy_irq ) {
302
- disable_irq_wake (qcom -> hs_phy_irq );
303
- disable_irq_nosync (qcom -> hs_phy_irq );
304
- }
319
+ dwc3_qcom_disable_wakeup_irq (qcom -> hs_phy_irq );
305
320
306
- if (qcom -> dp_hs_phy_irq ) {
307
- disable_irq_wake (qcom -> dp_hs_phy_irq );
308
- disable_irq_nosync (qcom -> dp_hs_phy_irq );
309
- }
321
+ dwc3_qcom_disable_wakeup_irq (qcom -> dp_hs_phy_irq );
310
322
311
- if (qcom -> dm_hs_phy_irq ) {
312
- disable_irq_wake (qcom -> dm_hs_phy_irq );
313
- disable_irq_nosync (qcom -> dm_hs_phy_irq );
314
- }
323
+ dwc3_qcom_disable_wakeup_irq (qcom -> dm_hs_phy_irq );
315
324
316
- if (qcom -> ss_phy_irq ) {
317
- disable_irq_wake (qcom -> ss_phy_irq );
318
- disable_irq_nosync (qcom -> ss_phy_irq );
319
- }
325
+ dwc3_qcom_disable_wakeup_irq (qcom -> ss_phy_irq );
320
326
}
321
327
322
328
static void dwc3_qcom_enable_interrupts (struct dwc3_qcom * qcom )
323
329
{
324
- if (qcom -> hs_phy_irq ) {
325
- enable_irq (qcom -> hs_phy_irq );
326
- enable_irq_wake (qcom -> hs_phy_irq );
327
- }
330
+ dwc3_qcom_enable_wakeup_irq (qcom -> hs_phy_irq );
328
331
329
- if (qcom -> dp_hs_phy_irq ) {
330
- enable_irq (qcom -> dp_hs_phy_irq );
331
- enable_irq_wake (qcom -> dp_hs_phy_irq );
332
- }
332
+ dwc3_qcom_enable_wakeup_irq (qcom -> dp_hs_phy_irq );
333
333
334
- if (qcom -> dm_hs_phy_irq ) {
335
- enable_irq (qcom -> dm_hs_phy_irq );
336
- enable_irq_wake (qcom -> dm_hs_phy_irq );
337
- }
334
+ dwc3_qcom_enable_wakeup_irq (qcom -> dm_hs_phy_irq );
338
335
339
- if (qcom -> ss_phy_irq ) {
340
- enable_irq (qcom -> ss_phy_irq );
341
- enable_irq_wake (qcom -> ss_phy_irq );
342
- }
336
+ dwc3_qcom_enable_wakeup_irq (qcom -> ss_phy_irq );
343
337
}
344
338
345
339
static int dwc3_qcom_suspend (struct dwc3_qcom * qcom )
0 commit comments