diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-01-11 09:05:35 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-02-25 06:28:06 -0500 |
commit | b840bc11b5062803c204d8a9625a1a1c5812d6d6 (patch) | |
tree | 8d082b6b3846b3dbaafa6f347957cf41137c8f20 /drivers/mtd | |
parent | 17fabf156507ec0f688f1e58be02f38e04de0c6e (diff) |
mtd: mxc-nand: no need to check for validity of platform driver data
The probe function calls platform_set_drvdata with a valid pointer when
the probe is successful. As mxcnd_suspend and mxcnd_resume are only
called on bound devices, platform_get_drvdata always returns non-NULL.
This fix isn't critical as the pointer is always valid so it doesn't
matter if the compiler generated code for it or not.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/mxc_nand.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 45dec5770da0..84f363571c24 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c | |||
@@ -886,11 +886,10 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) | |||
886 | int ret = 0; | 886 | int ret = 0; |
887 | 887 | ||
888 | DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); | 888 | DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); |
889 | if (mtd) { | 889 | |
890 | ret = mtd->suspend(mtd); | 890 | ret = mtd->suspend(mtd); |
891 | /* Disable the NFC clock */ | 891 | /* Disable the NFC clock */ |
892 | clk_disable(host->clk); | 892 | clk_disable(host->clk); |
893 | } | ||
894 | 893 | ||
895 | return ret; | 894 | return ret; |
896 | } | 895 | } |
@@ -904,11 +903,9 @@ static int mxcnd_resume(struct platform_device *pdev) | |||
904 | 903 | ||
905 | DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); | 904 | DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); |
906 | 905 | ||
907 | if (mtd) { | 906 | /* Enable the NFC clock */ |
908 | /* Enable the NFC clock */ | 907 | clk_enable(host->clk); |
909 | clk_enable(host->clk); | 908 | mtd->resume(mtd); |
910 | mtd->resume(mtd); | ||
911 | } | ||
912 | 909 | ||
913 | return ret; | 910 | return ret; |
914 | } | 911 | } |