Skip to content

Commit 2a49b45

Browse files
Guanbing Huanggregkh
authored andcommitted
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]>
1 parent c205edc commit 2a49b45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/pnp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ int compare_pnp_id(struct pnp_id *pos, const char *id);
469469
int pnp_register_driver(struct pnp_driver *drv);
470470
void pnp_unregister_driver(struct pnp_driver *drv);
471471

472+
#define dev_is_pnp(d) ((d)->bus == &pnp_bus_type)
473+
472474
#else
473475

474476
/* device management */
@@ -500,6 +502,8 @@ static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -E
500502
static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
501503
static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
502504

505+
#define dev_is_pnp(d) false
506+
503507
#endif /* CONFIG_PNP */
504508

505509
/**

0 commit comments

Comments
 (0)