mbox series

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

Message ID 20230321084125.337021-1-u.kleine-koenig@pengutronix.de (mailing list archive)
Headers show
Series iommu: Convert to platform remove callback returning void | expand

Message

Uwe Kleine-König March 21, 2023, 8:41 a.m. UTC
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

Comments

Joerg Roedel March 31, 2023, 8:02 a.m. UTC | #1
On Tue, Mar 21, 2023 at 09:41:15AM +0100, Uwe Kleine-König wrote:
> 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

Applied, thanks.