From: Marek Szyprowski Date: Wed, 19 Nov 2014 11:15:31 +0000 (+0000) Subject: iommu: fix initialization without 'add_device' callback X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=461bfb3fe7d0cf64d9ee2190ad8507e460fab198;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git iommu: fix initialization without 'add_device' callback IOMMU drivers can be initialized from of_iommu helpers. Such drivers don't need to provide device_add callbacks to operate properly, so there is no need to fail initialization if the callback is missing. Acked-by: Arnd Bergmann Signed-off-by: Marek Szyprowski Signed-off-by: Will Deacon --- diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index ed8b04867b1f..02f798b7e295 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -737,7 +737,7 @@ static int add_iommu_group(struct device *dev, void *data) const struct iommu_ops *ops = cb->ops; if (!ops->add_device) - return -ENODEV; + return 0; WARN_ON(dev->iommu_group);