Hi Luca,

On 3/14/22 10:50 AM, Luca Fancellu wrote:
+int iommu_remove_dt_device(struct dt_device_node *np)
+{
+    const struct iommu_ops *ops = iommu_get_ops();
+    struct device *dev = dt_to_dev(np);
+    int rc;
+
+    if ( !ops )
+        return -EOPNOTSUPP;
Here we have that the counterpart iommu_add_dt_device returns EINVAL here and...
I add EINVAL here in v1 but Julien suggested to change it ot EOPNOTSUPP.
+
+    spin_lock(&dtdevs_lock);
+
+    if ( iommu_dt_device_is_assigned_lock(np) ) {
+        rc = -EBUSY;
+        goto fail;
+    }
+
+    /*
+     * The driver which supports generic IOMMU DT bindings must have
+     * these callback implemented.
+     */
+    if ( !ops->remove_device ) {
+        rc = -EOPNOTSUPP;
… here (for !ops->add_device), so I’m wondering if there is a mistake.
+        goto fail;
+    }
+


Reply via email to