[PATCH 0/3] of: unittest: Convert to platform remove callback returning void

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

this series converts the of unittests 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.

The first patch is an orthogonal cleanup. The second patch fixes the one
driver that doesn't already always return zero in .remove(). The last
patch does the actual conversion.

Best regards
Uwe

Uwe Kleine-König (3):
  of: unittest: Drop call to platform_set_drvdata(..., NULL)
  of: unittest: Drop if blocks with always false condition
  of: unittest: Convert to platform remove callback returning void

 drivers/of/unittest.c | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)


base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.2




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux