Lines Matching refs:iommu
54 int iommu_device_sysfs_add(struct iommu_device *iommu, in iommu_device_sysfs_add() argument
62 iommu->dev = kzalloc(sizeof(*iommu->dev), GFP_KERNEL); in iommu_device_sysfs_add()
63 if (!iommu->dev) in iommu_device_sysfs_add()
66 device_initialize(iommu->dev); in iommu_device_sysfs_add()
68 iommu->dev->class = &iommu_class; in iommu_device_sysfs_add()
69 iommu->dev->parent = parent; in iommu_device_sysfs_add()
70 iommu->dev->groups = groups; in iommu_device_sysfs_add()
73 ret = kobject_set_name_vargs(&iommu->dev->kobj, fmt, vargs); in iommu_device_sysfs_add()
78 ret = device_add(iommu->dev); in iommu_device_sysfs_add()
82 dev_set_drvdata(iommu->dev, iommu); in iommu_device_sysfs_add()
87 put_device(iommu->dev); in iommu_device_sysfs_add()
92 void iommu_device_sysfs_remove(struct iommu_device *iommu) in iommu_device_sysfs_remove() argument
94 dev_set_drvdata(iommu->dev, NULL); in iommu_device_sysfs_remove()
95 device_unregister(iommu->dev); in iommu_device_sysfs_remove()
96 iommu->dev = NULL; in iommu_device_sysfs_remove()
106 int iommu_device_link(struct iommu_device *iommu, struct device *link) in iommu_device_link() argument
110 if (!iommu || IS_ERR(iommu)) in iommu_device_link()
113 ret = sysfs_add_link_to_group(&iommu->dev->kobj, "devices", in iommu_device_link()
118 ret = sysfs_create_link_nowarn(&link->kobj, &iommu->dev->kobj, "iommu"); in iommu_device_link()
120 sysfs_remove_link_from_group(&iommu->dev->kobj, "devices", in iommu_device_link()
127 void iommu_device_unlink(struct iommu_device *iommu, struct device *link) in iommu_device_unlink() argument
129 if (!iommu || IS_ERR(iommu)) in iommu_device_unlink()
133 sysfs_remove_link_from_group(&iommu->dev->kobj, "devices", dev_name(link)); in iommu_device_unlink()