mbox series

[0/6] Make remove() of any bus based driver void returned

Message ID TYCP286MB23234ABCCF40E3FC42FD09A4CA189@TYCP286MB2323.JPNP286.PROD.OUTLOOK.COM (mailing list archive)
Headers show
Series Make remove() of any bus based driver void returned | expand

Message

Dawei Li Dec. 5, 2022, 3:36 p.m. UTC
For bus-based driver, device removal is implemented as:
device_remove() => bus->remove() => driver->remove()

Driver core needs no feedback from bus driver about the result of
remove callback. In which case, commit fc7a6209d571 ("bus: Make
remove callback return void") forces bus_type::remove be void-returned.

Now we have the situation that both 1st & 2nd part of calling chain
are void returned, so it does not make much sense for the last one
(driver->remove) to return non-void to its caller.

So the basic idea behind this patchset is making remove() callback of
any bus-based driver to be void returned.

This patchset includes changes for drivers below:
1. hyperv
2. macio
3. apr
4. xen
5. ac87
6. soundbus

Q: Why not platform drivers?
A: Too many of them.(maybe 4K+)

Dawei Li (6):
  hyperv: Make remove callback of hyperv driver void returned
  macio: Make remove callback of macio driver void returned
  apr: make remove callback of apr driver void returned
  xen: make remove callback of xen driver void returned
  ac97: make remove callback of ac97 driver void returned
  soundbus: make remove callback of soundbus driver void returned

 arch/powerpc/include/asm/macio.h                | 12 ++++++------
 drivers/ata/pata_macio.c                        |  4 +---
 drivers/block/xen-blkback/xenbus.c              |  4 +---
 drivers/block/xen-blkfront.c                    |  3 +--
 drivers/char/tpm/xen-tpmfront.c                 |  3 +--
 drivers/gpu/drm/hyperv/hyperv_drm_drv.c         |  4 +---
 drivers/gpu/drm/xen/xen_drm_front.c             |  3 +--
 drivers/hid/hid-hyperv.c                        |  4 +---
 drivers/hv/hv_balloon.c                         |  5 +----
 drivers/hv/hv_util.c                            |  4 +---
 drivers/input/misc/xen-kbdfront.c               |  5 ++---
 drivers/input/serio/hyperv-keyboard.c           |  4 +---
 drivers/macintosh/rack-meter.c                  |  4 +---
 drivers/mfd/wm97xx-core.c                       |  4 +---
 drivers/net/ethernet/apple/bmac.c               |  4 +---
 drivers/net/ethernet/apple/mace.c               |  4 +---
 drivers/net/hyperv/netvsc_drv.c                 |  4 +---
 drivers/net/wireless/intersil/orinoco/airport.c |  4 +---
 drivers/net/xen-netback/xenbus.c                |  3 +--
 drivers/net/xen-netfront.c                      |  4 +---
 drivers/pci/controller/pci-hyperv.c             |  3 +--
 drivers/pci/xen-pcifront.c                      |  4 +---
 drivers/scsi/mac53c94.c                         |  5 +----
 drivers/scsi/mesh.c                             |  5 +----
 drivers/scsi/storvsc_drv.c                      |  4 +---
 drivers/scsi/xen-scsifront.c                    |  4 +---
 drivers/tty/hvc/hvc_xen.c                       |  4 ++--
 drivers/tty/serial/pmac_zilog.c                 |  7 ++-----
 drivers/uio/uio_hv_generic.c                    |  5 ++---
 drivers/usb/host/xen-hcd.c                      |  4 +---
 drivers/video/fbdev/hyperv_fb.c                 |  5 +----
 drivers/video/fbdev/xen-fbfront.c               |  6 ++----
 drivers/xen/pvcalls-back.c                      |  3 +--
 drivers/xen/pvcalls-front.c                     |  3 +--
 drivers/xen/xen-pciback/xenbus.c                |  4 +---
 drivers/xen/xen-scsiback.c                      |  4 +---
 include/linux/hyperv.h                          |  2 +-
 include/linux/soc/qcom/apr.h                    |  2 +-
 include/sound/ac97/codec.h                      |  6 +++---
 include/xen/xenbus.h                            |  2 +-
 net/9p/trans_xen.c                              |  3 +--
 net/vmw_vsock/hyperv_transport.c                |  4 +---
 sound/ac97/bus.c                                |  5 ++---
 sound/aoa/fabrics/layout.c                      |  3 +--
 sound/aoa/soundbus/i2sbus/core.c                |  4 +---
 sound/aoa/soundbus/soundbus.h                   |  6 +++---
 sound/soc/qcom/qdsp6/q6core.c                   |  4 +---
 sound/xen/xen_snd_front.c                       |  3 +--
 48 files changed, 63 insertions(+), 137 deletions(-)

Comments

Dawei Li Dec. 6, 2022, 2:33 p.m. UTC | #1
On Mon, Dec 05, 2022 at 05:00:52PM +0100, Greg KH wrote:
> On Mon, Dec 05, 2022 at 11:36:38PM +0800, Dawei Li wrote:
> > For bus-based driver, device removal is implemented as:
> > device_remove() => bus->remove() => driver->remove()
> > 
> > Driver core needs no feedback from bus driver about the result of
> > remove callback. In which case, commit fc7a6209d571 ("bus: Make
> > remove callback return void") forces bus_type::remove be void-returned.
> > 
> > Now we have the situation that both 1st & 2nd part of calling chain
> > are void returned, so it does not make much sense for the last one
> > (driver->remove) to return non-void to its caller.
> > 
> > So the basic idea behind this patchset is making remove() callback of
> > any bus-based driver to be void returned.
> > 
> > This patchset includes changes for drivers below:
> > 1. hyperv
> > 2. macio
> > 3. apr
> > 4. xen
> > 5. ac87
> > 6. soundbus

Hi Greg:
Thanks for the reviewing.
> 
> Then that should be 6 different patchsets going to 6 different
> subsystems.  No need to make this seems like a unified set of patches at
> all.
Right, will fix all the issues for this patchset and resend them in 6
independent patches.

Thanks
      Dawei

> 
> > Q: Why not platform drivers?
> > A: Too many of them.(maybe 4K+)
> 
> That will have to be done eventually, right?
> 
> thanks,
> 
> greg k-h