[<prev] [next>] [day] [month] [year] [list]
Message-ID: <40ba9761-3f51-3f7f-5026-eed613dbf6dc@web.de>
Date: Tue, 14 Jul 2020 10:48:18 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Clark Wang <xiaoning.wang@....com>, linux-spi@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 2/5] spi: lpspi: add NULL check when probe device
…
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -841,6 +841,11 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
> u32 temp;
> bool is_slave;
>
> + if (!np && !lpspi_platform_info) {
> + dev_err(&pdev->dev, "can't get the platform data\n");
> + return -EINVAL;
> + }
…
How do you think about to combine these null pointer checks by the logical
operator “or” instead of “and”?
Regards,
Markus
Powered by blists - more mailing lists