diff --git a/sys/external/bsd/dwc2/dist/dwc2_hcd.c b/sys/external/bsd/dwc2/dist/dwc2_hcd.c index 11c0d0fdbb40..15fd8ae2a2f5 100644 --- a/sys/external/bsd/dwc2/dist/dwc2_hcd.c +++ b/sys/external/bsd/dwc2/dist/dwc2_hcd.c @@ -1902,8 +1902,14 @@ dwc2_hcd_urb_alloc(struct dwc2_hsotg *hsotg, int iso_desc_count, struct dwc2_hcd_urb *urb; u32 size = sizeof(*urb) + iso_desc_count * sizeof(struct dwc2_hcd_iso_packet_desc); + int kmem_flag; - urb = kmem_zalloc(size, mem_flags); + if ((mem_flags & __GFP_WAIT) == __GFP_WAIT) + kmem_flag = KM_SLEEP; + else + kmem_flag = KM_NOSLEEP; + + urb = kmem_zalloc(size, kmem_flag); if (urb) urb->packet_count = iso_desc_count; return urb; diff --git a/sys/external/bsd/dwc2/dwc2.h b/sys/external/bsd/dwc2/dwc2.h index fd0177df3cab..42eede6eb5f9 100644 --- a/sys/external/bsd/dwc2/dwc2.h +++ b/sys/external/bsd/dwc2/dwc2.h @@ -108,10 +108,6 @@ extern int dwc2debug; #define jiffies hardclock_ticks #define msecs_to_jiffies mstohz -#define gfp_t int -#define GFP_KERNEL KM_SLEEP -#define GFP_ATOMIC KM_NOSLEEP - enum usb_otg_state { OTG_STATE_RESERVED = 0,