[bug report] PCI: mediatek: Add controller support for MT2712 and MT7622

Dan Carpenter dan.carpenter at oracle.com
Fri Aug 25 05:27:43 PDT 2017


Hello Ryder Lee,

The patch 6a48aa410571: "PCI: mediatek: Add controller support for
MT2712 and MT7622" from Aug 10, 2017, leads to the following static
checker warning:

	drivers/pci/host/pcie-mediatek.c:453 mtk_pcie_init_irq_domain()
	warn: passing zero to 'PTR_ERR'

	drivers/pci/host/pcie-mediatek.c:460 mtk_pcie_init_irq_domain()
	warn: passing zero to 'PTR_ERR'

drivers/pci/host/pcie-mediatek.c
   443  static int mtk_pcie_init_irq_domain(struct mtk_pcie_port *port,
   444                                      struct device_node *node)
   445  {
   446          struct device *dev = port->pcie->dev;
   447          struct device_node *pcie_intc_node;
   448  
   449          /* Setup INTx */
   450          pcie_intc_node = of_get_next_child(node, NULL);
   451          if (!pcie_intc_node) {
   452                  dev_err(dev, "no PCIe Intc node found\n");
   453                  return PTR_ERR(pcie_intc_node);
                               ^^^^^^^^^^^^^^^^^^^^^^^
This is a complicated way of returning 0, but I'm not sure what we
should actually be returning here.

   454          }
   455  
   456          port->irq_domain = irq_domain_add_linear(pcie_intc_node, INTX_NUM,
   457                                                   &intx_domain_ops, port);
   458          if (!port->irq_domain) {
   459                  dev_err(dev, "failed to get INTx IRQ domain\n");
   460                  return PTR_ERR(port->irq_domain);
                               ^^^^^^^^^^^^^^^^^^^^^^^^
Also zero.

   461          }
   462  
   463          return 0;
   464  }

regards,
dan carpenter



More information about the Linux-mediatek mailing list