File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -337,14 +337,19 @@ static const struct irq_domain_ops msi_domain_ops = {
337
337
* xilinx_pcie_enable_msi - Enable MSI support
338
338
* @port: PCIe port information
339
339
*/
340
- static void xilinx_pcie_enable_msi (struct xilinx_pcie_port * port )
340
+ static int xilinx_pcie_enable_msi (struct xilinx_pcie_port * port )
341
341
{
342
342
phys_addr_t msg_addr ;
343
343
344
344
port -> msi_pages = __get_free_pages (GFP_KERNEL , 0 );
345
+ if (!port -> msi_pages )
346
+ return - ENOMEM ;
347
+
345
348
msg_addr = virt_to_phys ((void * )port -> msi_pages );
346
349
pcie_write (port , 0x0 , XILINX_PCIE_REG_MSIBASE1 );
347
350
pcie_write (port , msg_addr , XILINX_PCIE_REG_MSIBASE2 );
351
+
352
+ return 0 ;
348
353
}
349
354
350
355
/* INTx Functions */
@@ -516,6 +521,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
516
521
struct device * dev = port -> dev ;
517
522
struct device_node * node = dev -> of_node ;
518
523
struct device_node * pcie_intc_node ;
524
+ int ret ;
519
525
520
526
/* Setup INTx */
521
527
pcie_intc_node = of_get_next_child (node , NULL );
@@ -544,7 +550,9 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port)
544
550
return - ENODEV ;
545
551
}
546
552
547
- xilinx_pcie_enable_msi (port );
553
+ ret = xilinx_pcie_enable_msi (port );
554
+ if (ret )
555
+ return ret ;
548
556
}
549
557
550
558
return 0 ;
You can’t perform that action at this time.
0 commit comments