lkml.org 
[lkml]   [2021]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER
Date
From: Alice Guo <alice.guo@nxp.com>

In i.MX8M boards, the registration of SoC device is later than caam
driver which needs it. Caam driver needs soc_device_match to provide
-EPROBE_DEFER when no SoC device is registered and no
early_soc_dev_attr.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
drivers/base/soc.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index 0af5363a582c..12a22f9cf5c8 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -110,6 +110,7 @@ static void soc_release(struct device *dev)
}

static struct soc_device_attribute *early_soc_dev_attr;
+static bool soc_dev_attr_init_done = false;

struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr)
{
@@ -157,6 +158,7 @@ struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr
return ERR_PTR(ret);
}

+ soc_dev_attr_init_done = true;
return soc_dev;

out3:
@@ -246,6 +248,9 @@ const struct soc_device_attribute *soc_device_match(
if (!matches)
return NULL;

+ if (!soc_dev_attr_init_done && !early_soc_dev_attr)
+ return ERR_PTR(-EPROBE_DEFER);
+
while (!ret) {
if (!(matches->machine || matches->family ||
matches->revision || matches->soc_id))
--
2.17.1
\
 
 \ /
  Last update: 2021-04-19 06:28    [W:0.165 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site