summaryrefslogtreecommitdiff
path: root/drivers/core/syscon-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-02-16 20:24:38 -0700
committerBin Meng <bmeng.cn@gmail.com>2019-02-20 15:21:44 +0800
commit529f57d92666631383fb3d8fff50028da91de006 (patch)
tree79c91f8996850cc19f929d769c825415b0f58fce /drivers/core/syscon-uclass.c
parentf9811e8575eb42e75c615ba9b44f0481cdb78330 (diff)
dm: syscon: Don't require a regmap for PCI devices
At present it is not possible to use the syscon devices for PCI devices since a regmap is required. Since PCI uses a 3-cell address the conversion of the 'reg' property to an address always fails. In any case, the regmap is not useful with PCI since devices are accessed through the PCI bus which regmap does not support. Add a special case for PCI syscon devices, so that they don't set up a regmap. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/core/syscon-uclass.c')
-rw-r--r--drivers/core/syscon-uclass.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c
index 3cf9dd9dbe..afac6d6e37 100644
--- a/drivers/core/syscon-uclass.c
+++ b/drivers/core/syscon-uclass.c
@@ -37,6 +37,10 @@ static int syscon_pre_probe(struct udevice *dev)
{
struct syscon_uc_info *priv = dev_get_uclass_priv(dev);
+ /* Special case for PCI devices, which don't have a regmap */
+ if (device_get_uclass_id(dev->parent) == UCLASS_PCI)
+ return 0;
+
/*
* With OF_PLATDATA we really have no way of knowing the format of
* the device-specific platform data. So we assume that it starts with