]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/of: Fix probe-deferral
authorRobin Murphy <robin.murphy@arm.com>
Mon, 7 Jan 2019 17:04:50 +0000 (17:04 +0000)
committerJoerg Roedel <jroedel@suse.de>
Fri, 11 Jan 2019 11:28:24 +0000 (12:28 +0100)
commit79c59e58766d00ef326fd1256e80d165a8174854
tree381cdad2ea681215ed766d433fd7d6302c4f8418
parentf9bb4b753eb00c02014e4467a28609f4f6ac7f88
iommu/of: Fix probe-deferral

Whilst iommu_probe_device() does check for non-NULL ops as the previous
code did, it does not do so in the same order relative to the other
checks, and as a result means that -EPROBE_DEFER returned by of_xlate()
(plus any real error condition too) gets overwritten with -EINVAL and
leads to various misbehaviour.

Reinstate the original logic, but without implicitly relying on ops
being set to infer !err as the initial condition (now that the validity
of ops for its own sake is checked elsewhere).

Fixes: b0611289316a ("iommu/of: Don't call iommu_ops->add_device directly")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/of_iommu.c