]> git.karo-electronics.de Git - linux-beck.git/commit
iommu/omap: Allocate archdata on the fly for DT-based devices
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 28 Feb 2014 20:42:38 +0000 (14:42 -0600)
committerJoerg Roedel <joro@8bytes.org>
Tue, 4 Mar 2014 16:02:43 +0000 (17:02 +0100)
commit07a0203021149140f83e64a9ac5fe7ed09a74afc
tree274fe2bd2984aad36c941fb0d1b7988638784afd
parentb148d5fb2ef7bd1441e95402effe22b7b34f9a73
iommu/omap: Allocate archdata on the fly for DT-based devices

The OMAP IOMMU driver locates the IOMMU associated to a device using the
IOMMU name stored in the device archdata iommu field. That field is
expected to be populated by platform code and is left unset for DT-based
devices. This results in a crash when the IOMMU driver attaches a domain
to a device.

Fix this by allocating the archdata iommu structure when devices are
added and freeing when they are removed. Devices without an OF node, and
devices without an iommus property in their OF node are ignored. The
iommu name is initialized from the IOMMU device node name.

This should be simplified when removing non-DT support completely from
the IOMMU users as the IOMMU name won't be needed anymore, and the
IOMMU device pointer could then be stored in the archdata iommu field
directly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[s-anna@ti.com: updated to use device name instead of OF name]
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
drivers/iommu/omap-iommu.c