Message ID | 20200714075251.12777-3-xiaoning.wang@nxp.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Some bug fix for lpspi | expand |
On Tue, Jul 14, 2020 at 03:52:48PM +0800, Clark Wang wrote: > Add a NULL check for device node and lpspi_platform_info when lpspi > device probe. This has build problems, I guess there's been a context change that's caused issues along with causing the later patches to not apply: /mnt/kernel/drivers/spi/spi-fsl-lpspi.c: In function 'fsl_lpspi_probe': /mnt/kernel/drivers/spi/spi-fsl-lpspi.c:824:7: error: 'np' undeclared (first use in this function); did you mean 'up'? if (!np && !lpspi_platform_info) { ^~ up /mnt/kernel/drivers/spi/spi-fsl-lpspi.c:824:7: note: each undeclared identifier is reported only once for each function it appears in /mnt/kernel/drivers/spi/spi-fsl-lpspi.c:824:14: error: 'lpspi_platform_info' undeclared (first use in this function); did you mean 'spi_board_info'? if (!np && !lpspi_platform_info) { ^~~~~~~~~~~~~~~~~~~ spi_board_info
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index a1555bbc5e5a..ca43d93adf30 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ 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; + } + is_slave = of_property_read_bool((&pdev->dev)->of_node, "spi-slave"); if (is_slave) controller = spi_alloc_slave(&pdev->dev,
Add a NULL check for device node and lpspi_platform_info when lpspi device probe. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> --- drivers/spi/spi-fsl-lpspi.c | 5 +++++ 1 file changed, 5 insertions(+)