mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
PNP: Add dev_is_pnp() macro
Add dev_is_pnp() macro to determine whether the device is a PNP device. Signed-off-by: Guanbing Huang <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Bing Fan <[email protected]> Tested-by: Linheng Du <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/r/4e68f5557ad53b671ca8103e572163eca52a8f29.1713234515.git.albanhuang@tencent.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c205edcd86
commit
2a49b45cd0
@@ -469,6 +469,8 @@ int compare_pnp_id(struct pnp_id *pos, const char *id);
|
||||
int pnp_register_driver(struct pnp_driver *drv);
|
||||
void pnp_unregister_driver(struct pnp_driver *drv);
|
||||
|
||||
#define dev_is_pnp(d) ((d)->bus == &pnp_bus_type)
|
||||
|
||||
#else
|
||||
|
||||
/* device management */
|
||||
@@ -500,6 +502,8 @@ static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -E
|
||||
static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
|
||||
static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
|
||||
|
||||
#define dev_is_pnp(d) false
|
||||
|
||||
#endif /* CONFIG_PNP */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user