Skip to content

Commit

Permalink
mtd: mxc-nand: no need to check for validity of platform driver data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and David Woodhouse committed Feb 25, 2010
1 parent 17fabf1 commit b840bc1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/mtd/nand/mxc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,10 @@ static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)
int ret = 0;

DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");
if (mtd) {
ret = mtd->suspend(mtd);
/* Disable the NFC clock */
clk_disable(host->clk);
}

ret = mtd->suspend(mtd);
/* Disable the NFC clock */
clk_disable(host->clk);

return ret;
}
Expand All @@ -904,11 +903,9 @@ static int mxcnd_resume(struct platform_device *pdev)

DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");

if (mtd) {
/* Enable the NFC clock */
clk_enable(host->clk);
mtd->resume(mtd);
}
/* Enable the NFC clock */
clk_enable(host->clk);
mtd->resume(mtd);

return ret;
}
Expand Down

0 comments on commit b840bc1

Please sign in to comment.