projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3fa43d0
)
MLK-21520-1 spi: lpspi: add NULL check when probe device
author
Clark Wang
<xiaoning.wang@nxp.com>
Tue, 23 Apr 2019 07:11:58 +0000
(15:11 +0800)
committer
Clark Wang
<xiaoning.wang@nxp.com>
Tue, 23 Apr 2019 08:58:05 +0000
(16:58 +0800)
Add a NULL check for device node and lpspi_platform_info when lpspi
device probe.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
drivers/spi/spi-fsl-lpspi.c
patch
|
blob
|
history
diff --git
a/drivers/spi/spi-fsl-lpspi.c
b/drivers/spi/spi-fsl-lpspi.c
index
0c38d79
..
38a7a3b
100644
(file)
--- a/
drivers/spi/spi-fsl-lpspi.c
+++ b/
drivers/spi/spi-fsl-lpspi.c
@@
-829,6
+829,11
@@
static int fsl_lpspi_probe(struct platform_device *pdev)
int i, ret, irq;
u32 temp;
+ if (!np && !lpspi_platform_info) {
+ dev_err(&pdev->dev, "can't get the platform data\n");
+ return -EINVAL;
+ }
+
if (of_property_read_bool((&pdev->dev)->of_node, "spi-slave"))
controller = spi_alloc_slave(&pdev->dev,
sizeof(struct fsl_lpspi_data));