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
  • class.h
Find file BlameHistoryPermalink
  • Zijun Hu's avatar
    drivers/base: Introduce device_match_t for device finding APIs · b45ed06f
    Zijun Hu authored Aug 13, 2024
    
    
    There are several drivers/base APIs for finding a specific device, and
    they currently use the following good type for the @match parameter:
    int (*match)(struct device *dev, const void *data)
    
    Since these operations do not modify the caller-provided @*data, this
    type is worthy of a dedicated typedef:
    typedef int (*device_match_t)(struct device *dev, const void *data)
    
    Advantages of using device_match_t:
     - Shorter API declarations and definitions
     - Prevent further APIs from using a bad type for @match
    
    So introduce device_match_t and apply it to the existing
    (bus|class|driver|auxiliary)_find_device() APIs.
    
    Signed-off-by: default avatarZijun Hu <quic_zijuhu@quicinc.com>
    Link: https://lore.kernel.org/r/20240813-dev_match_api-v3-1-6c6878a99b9f@quicinc.com
    
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b45ed06f
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7