[bug report] drm/msm/dsi: do not enable irq handler before powering up the host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Dmitry Baryshkov,

The patch bf94ec093d05: "drm/msm/dsi: do not enable irq handler
before powering up the host" from Oct 2, 2021, leads to the following
Smatch static checker warning:

	drivers/gpu/drm/msm/dsi/dsi_host.c:1890 msm_dsi_host_init()
	warn: irq_of_parse_and_map() returns zero on failure

drivers/gpu/drm/msm/dsi/dsi_host.c
    1882         /* OPP table is optional */
    1883         ret = devm_pm_opp_of_add_table(&pdev->dev);
    1884         if (ret && ret != -ENODEV) {
    1885                 dev_err(&pdev->dev, "invalid OPP table in device tree\n");
    1886                 return ret;
    1887         }
    1888 
    1889         msm_host->irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
--> 1890         if (msm_host->irq < 0) {

The irq_of_parse_and_map() function returns zero on error.  There are
several IRQ functions like that.  It's a mess.

So I think this should be if (!msm_host->irq) or possibly if <= 0.

    1891                 ret = msm_host->irq;
    1892                 dev_err(&pdev->dev, "failed to get irq: %d\n", ret);
    1893                 return ret;
    1894         }
    1895 
    1896         /* do not autoenable, will be enabled later */

regards,
dan carpenter



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux