Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • include
  • linux
  • device.h
Find file BlameHistoryPermalink
  • Jason Gunthorpe's avatar
    driver core: Export device_driver_attach() · 0d9f837c
    Jason Gunthorpe authored Jun 17, 2021
    
    
    This is intended as a replacement API for device_bind_driver(). It has at
    least the following benefits:
    
    - Internal locking. Few of the users of device_bind_driver() follow the
      locking rules
    
    - Calls device driver probe() internally. Notably this means that devm
      support for probe works correctly as probe() error will call
      devres_release_all()
    
    - struct device_driver -> dev_groups is supported
    
    - Simplified calling convention, no need to manually call probe().
    
    The general usage is for situations that already know what driver to bind
    and need to ensure the bind is synchronized with other logic. Call
    device_driver_attach() after device_add().
    
    If probe() returns a failure then this will be preserved up through to the
    error return of device_driver_attach().
    
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
    Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://lore.kernel.org/r/20210617142218.1877096-6-hch@lst.de
    
    
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    0d9f837c
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7