[PATCH -next 9/9] ASoC: fsl_xcvr: check return value after calling platform_get_resource_byname()

Timur Tabi timur at kernel.org
Mon Jun 14 00:00:25 AEST 2021


On Fri, Jun 11, 2021 at 4:32 AM Yang Yingliang <yangyingliang at huawei.com> wrote:

>         rx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rxfifo");
>         tx_res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "txfifo");
> +       if (!rx_res || !tx_res) {
> +               dev_err(dev, "Invalid resource\n");
> +               return -EINVAL;
> +       }

If platform_get_resource_byname() returns an error, it's probably
because the name cannot be found.  So I think this error message is
more accurate:

"could not find rxfifo or txfifo resource"


More information about the Linuxppc-dev mailing list