Re: [PATCH] iommu/ipmmu-vmsa: Use iommu_device_sysfs_add()/remove()

2017-08-22 Thread Joerg Roedel
On Mon, Aug 21, 2017 at 02:53:35PM +0900, Magnus Damm wrote:
> From: Magnus Damm 
> 
> Extend the driver to make use of iommu_device_sysfs_add()/remove()
> functions to hook up initial sysfs support.
> 
> Suggested-by: Joerg Roedel 
> Signed-off-by: Magnus Damm 

Applied, thanks.



[PATCH] iommu/ipmmu-vmsa: Use iommu_device_sysfs_add()/remove()

2017-08-20 Thread Magnus Damm
From: Magnus Damm 

Extend the driver to make use of iommu_device_sysfs_add()/remove()
functions to hook up initial sysfs support.

Suggested-by: Joerg Roedel 
Signed-off-by: Magnus Damm 
---

 Applies on top of next-20170817

 drivers/iommu/ipmmu-vmsa.c |6 ++
 1 file changed, 6 insertions(+)

--- 0001/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2017-08-21 14:40:13.940607110 +0900
@@ -953,6 +953,11 @@ static int ipmmu_probe(struct platform_d
 
ipmmu_device_reset(mmu);
 
+   ret = iommu_device_sysfs_add(>iommu, >dev, NULL,
+dev_name(>dev));
+   if (ret)
+   return ret;
+
iommu_device_set_ops(>iommu, _ops);
iommu_device_set_fwnode(>iommu, >dev.of_node->fwnode);
 
@@ -975,6 +980,7 @@ static int ipmmu_remove(struct platform_
 {
struct ipmmu_vmsa_device *mmu = platform_get_drvdata(pdev);
 
+   iommu_device_sysfs_remove(>iommu);
iommu_device_unregister(>iommu);
 
 #if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)