lkml.org 
[lkml]   [2014]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ASoC: fsl-sai: Add device tree nodes and its availiable check
Date
SAIs that are not connected on the board should have a
status = "disabled" property in their device tree nodes.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
sound/soc/fsl/fsl_sai.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index cdd3fa8..6b2ab91 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -404,6 +404,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
struct resource *res;
int ret;

+ if (!np || !of_device_is_available(np))
+ return -ENODEV;
+
sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL);
if (!sai)
return -ENOMEM;
--
1.8.4



\
 
 \ /
  Last update: 2014-01-10 04:21    [W:0.051 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site