diff options
| author | 2020-11-27 21:04:53 +0100 | |
|---|---|---|
| committer | 2020-11-27 21:04:53 +0100 | |
| commit | 718e43b5f850a8fb52933ac5ecf29f5eef48a349 (patch) | |
| tree | 7b300d58e0c4c654c62e9d9873097ad0a860367d /drivers/base/core.c | |
| parent | Merge tag 'tegra-for-5.11-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers (diff) | |
| parent | Linux 5.10-rc2 (diff) | |
| download | linux-dev-718e43b5f850a8fb52933ac5ecf29f5eef48a349.tar.xz linux-dev-718e43b5f850a8fb52933ac5ecf29f5eef48a349.zip | |
Backmerge tag 'v5.10-rc2' into arm/drivers
The SCMI pull request for the arm/drivers branch requires v5.10-rc2
because of dependencies with other git trees, so merge that in here.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/base/core.c')
| -rw-r--r-- | drivers/base/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index c852f16c111b..78114ddac755 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4264,6 +4264,7 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode) */ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) { + struct device *parent = dev->parent; struct fwnode_handle *fn = dev->fwnode; if (fwnode) { @@ -4278,7 +4279,8 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) } else { if (fwnode_is_primary(fn)) { dev->fwnode = fn->secondary; - fn->secondary = NULL; + if (!(parent && fn == parent->fwnode)) + fn->secondary = ERR_PTR(-ENODEV); } else { dev->fwnode = NULL; } |
