[PATCH 00/10] iommu: Convert to platform remove callback returning void

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Mar 21 01:41:15 PDT 2023


Hello,

this series adapts the platform drivers below drivers/iommu to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver core
doesn't (and cannot) cope for errors during remove. The only effect of a
non-zero return value in .remove() is that the driver core emits a warning. The
device is removed anyhow and an early return from .remove() usually yields a
resource leak.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.

After the first patch all drivers return zero unconditionally in their
.remove() callback, then the remaining patches convert to .remove_new()
without side effects.

There is only a single interdependency (namely patch #4 depends on #1).
If there are concerns for individual patches[1], please still apply the
others. Then I'd only care for the actual change requests and don't need
to resend the other unchanged patches at a later point in time.

Thanks
Uwe

[1] I don't expect something more tragic than "You picked the wrong
subject prefix" or similar.

Uwe Kleine-König (10):
  iommu/arm-smmu: Drop if with an always false condition
  iommu/apple-dart: Convert to platform remove callback returning void
  iommu/arm-smmu-v3: Convert to platform remove callback returning void
  iommu/arm-smmu: Convert to platform remove callback returning void
  iommu/ipmmu-vmsa: Convert to platform remove callback returning void
  iommu/msm: Convert to platform remove callback returning void
  iommu/mtk: Convert to platform remove callback returning void
  iommu/mtk_iommu_v1: Convert to platform remove callback returning void
  iommu/omap: Convert to platform remove callback returning void
  iommu/sprd: Convert to platform remove callback returning void

 drivers/iommu/apple-dart.c                  |  6 ++----
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |  6 ++----
 drivers/iommu/arm/arm-smmu/arm-smmu.c       | 12 ++----------
 drivers/iommu/arm/arm-smmu/qcom_iommu.c     | 12 ++++--------
 drivers/iommu/ipmmu-vmsa.c                  |  6 ++----
 drivers/iommu/msm_iommu.c                   |  5 ++---
 drivers/iommu/mtk_iommu.c                   |  5 ++---
 drivers/iommu/mtk_iommu_v1.c                |  5 ++---
 drivers/iommu/omap-iommu.c                  |  5 ++---
 drivers/iommu/sprd-iommu.c                  |  6 ++----
 10 files changed, 22 insertions(+), 46 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.2




More information about the Linux-mediatek mailing list