• B
    [PATCH] hp300: fix driver_register() return handling, remove dio_module_init() · e51c01b0
    Bjorn Helgaas 提交于
    Remove the assumption that driver_register() returns the number of devices
    bound to the driver.  In fact, it returns zero for success or a negative
    error value.
    
    dio_module_init() used the device count to automatically unregister and
    unload drivers that found no devices.  That might have worked at one time,
    but has been broken for some time because dio_register_driver() returned
    either a negative error or a positive count (never zero).  So it could only
    unregister on failure, when it's not needed anyway.
    
    This functionality could be resurrected in individual drivers by counting
    devices in their .probe() methods.
    Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
    Cc: Philip Blundell <philb@gnu.org>
    Cc: Jochen Friedrich <jochen@scram.de>
    Cc: "Antonino A. Daplas" <adaplas@pol.net>
    Cc: Jeff Garzik <jeff@garzik.org>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    e51c01b0
hplance.c 7.0 KB