aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-07-11 04:58:38 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-09-29 09:53:21 -0400
commitb5170978b421222ba4c3d64d1ebd4a03d64ae42e (patch)
tree201a5dcc603699dab3bfceafad316378997e19c9 /drivers/mtd/devices
parent9c6f62a7ef230253a7dfc0547c431f07d8a64721 (diff)
mtd: spear_smi: failure test for null rather than negative integer
dev_get_platdata returns a pointer, so the failure value would be NULL rather than a negative integer. The semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,e; statement S1,S2; @@ *x = dev_get_platdata(...) ... when != x = e *if (x < 0) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/spear_smi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index b85f183d24c0..7c10466766c7 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct platform_device *pdev)
935 } 935 }
936 } else { 936 } else {
937 pdata = dev_get_platdata(&pdev->dev); 937 pdata = dev_get_platdata(&pdev->dev);
938 if (pdata < 0) { 938 if (!pdata) {
939 ret = -ENODEV; 939 ret = -ENODEV;
940 dev_err(&pdev->dev, "no platform data\n"); 940 dev_err(&pdev->dev, "no platform data\n");
941 goto err; 941 goto err;