[v1] memory: tegra30-emc: Fix panic on suspend
diff mbox series

Message ID 20191115162642.11397-1-digetx@gmail.com
State Accepted
Headers show
Series
  • [v1] memory: tegra30-emc: Fix panic on suspend
Related show

Commit Message

Dmitry Osipenko Nov. 15, 2019, 4:26 p.m. UTC
Trying to suspend driver results in a crash if timings aren't available in
device-tree.

Reported-by: Jon Hunter <jonathanh@nvidia.com>
Fixes: e34212c75a68 ("memory: tegra: Introduce Tegra30 EMC driver")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/memory/tegra/tegra30-emc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jon Hunter Nov. 18, 2019, 11:27 a.m. UTC | #1
On 15/11/2019 16:26, Dmitry Osipenko wrote:
> Trying to suspend driver results in a crash if timings aren't available in
> device-tree.
> 
> Reported-by: Jon Hunter <jonathanh@nvidia.com>
> Fixes: e34212c75a68 ("memory: tegra: Introduce Tegra30 EMC driver")
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  drivers/memory/tegra/tegra30-emc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c
> index 6929980bf907..0b6a5e451ea3 100644
> --- a/drivers/memory/tegra/tegra30-emc.c
> +++ b/drivers/memory/tegra/tegra30-emc.c
> @@ -1093,7 +1093,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
>  	if (of_get_child_count(pdev->dev.of_node) == 0) {
>  		dev_info(&pdev->dev,
>  			 "device-tree node doesn't have memory timings\n");
> -		return 0;
> +		return -ENODEV;
>  	}
>  
>  	np = of_parse_phandle(pdev->dev.of_node, "nvidia,memory-controller", 0);
> 

Thanks for the fix!

Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>

Jon

Patch
diff mbox series

diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c
index 6929980bf907..0b6a5e451ea3 100644
--- a/drivers/memory/tegra/tegra30-emc.c
+++ b/drivers/memory/tegra/tegra30-emc.c
@@ -1093,7 +1093,7 @@  static int tegra_emc_probe(struct platform_device *pdev)
 	if (of_get_child_count(pdev->dev.of_node) == 0) {
 		dev_info(&pdev->dev,
 			 "device-tree node doesn't have memory timings\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	np = of_parse_phandle(pdev->dev.of_node, "nvidia,memory-controller", 0);