Skip to content

Commit

Permalink
of.h: Improve of_match_node()
Browse files Browse the repository at this point in the history
Suppress the following compiler warning if CONFIG_OF=n:

> drivers/scsi/ufs-drivers/ufs-hisi.c:560:34: warning: unused variable 'ufs_hisi_of_match' [-Wunused-const-variable]

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
  • Loading branch information
bvanassche committed Mar 26, 2022
1 parent 976ba17 commit ac30f53
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/linux/of.h
Expand Up @@ -854,8 +854,14 @@ static inline phys_addr_t of_dma_get_max_cpu_address(struct device_node *np)
return PHYS_ADDR_MAX;
}

#define of_match_ptr(_ptr) NULL
#define of_match_node(_matches, _node) NULL
#define of_match_ptr(_ptr) ((_ptr), NULL)

static inline const struct of_device_id *
of_match_node(const struct of_device_id *matches,
const struct device_node *node)
{
return NULL;
}
#endif /* CONFIG_OF */

/* Default string compare functions, Allow arch asm/prom.h to override */
Expand Down

0 comments on commit ac30f53

Please sign in to comment.