aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2015-03-19 09:34:29 -0400
committerBrian Norris <computersforpeace@gmail.com>2015-03-30 20:49:07 -0400
commit62b57f4c1475a4c452000192e5cad2ae86164be5 (patch)
tree219bcf9ef500223358b8768a261e324455736e13 /drivers/mtd
parentd800fcabc75a091569b6e19a67844eb264c7db9b (diff)
mtd: fsmc_nand.c: Use default timings if none are provided in the dts
Without this patch the timings are all set to 0 if not specified in the dts. With this patch the driver falls back to use the defaults that are already present in the driver and are known to work okay for some (older) boards. Tested on a custom SPEAr600 based board. Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Viresh Kumar <viresh.linux@gmail.com> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/fsmc_nand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index edfaa21b1817..e58af4bfa8c8 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -873,6 +873,7 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
873{ 873{
874 struct fsmc_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); 874 struct fsmc_nand_platform_data *pdata = dev_get_platdata(&pdev->dev);
875 u32 val; 875 u32 val;
876 int ret;
876 877
877 /* Set default NAND width to 8 bits */ 878 /* Set default NAND width to 8 bits */
878 pdata->width = 8; 879 pdata->width = 8;
@@ -891,8 +892,12 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
891 sizeof(*pdata->nand_timings), GFP_KERNEL); 892 sizeof(*pdata->nand_timings), GFP_KERNEL);
892 if (!pdata->nand_timings) 893 if (!pdata->nand_timings)
893 return -ENOMEM; 894 return -ENOMEM;
894 of_property_read_u8_array(np, "timings", (u8 *)pdata->nand_timings, 895 ret = of_property_read_u8_array(np, "timings", (u8 *)pdata->nand_timings,
895 sizeof(*pdata->nand_timings)); 896 sizeof(*pdata->nand_timings));
897 if (ret) {
898 dev_info(&pdev->dev, "No timings in dts specified, using default timings!\n");
899 pdata->nand_timings = NULL;
900 }
896 901
897 /* Set default NAND bank to 0 */ 902 /* Set default NAND bank to 0 */
898 pdata->bank = 0; 903 pdata->bank = 0;