disp: msm: avoid using #ifdef for configurations
Use #if IS_ENABLED() instead of #ifdef for configurations as vendor module guidelines. Use #if IS_ENABLED(CONFIG_XXX) instead of #ifdef CONFIG_XXX to ensure that the code inside the #if block continues to compile if the config changes to a tristate config in the future. The differences are as follows: 1.#if IS_ENABLED(CONFIG_XXX) evaluates to true when CONFIG_XXX is set to module (=m) or built-in (=y). 2.#ifdef CONFIG_XXX evaluates to true when CONFIG_XXX is set to built-in(=y) , but doesn't when CONFIG_XXX is set to module(=m). Use this only when you're certain you want to do the same thing when the config is set to module or is disabled. Change-Id: Ia806b9b01ad8414d0e4de027a382cb68e7fb4a6a Signed-off-by: GG Hou <quic_renjhou@quicinc.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -59,9 +60,9 @@ enum dp_aux_bridge_flag {
|
||||
* @head: to keep track of all added bridges
|
||||
*/
|
||||
struct dp_aux_bridge {
|
||||
#ifdef CONFIG_OF
|
||||
#if IS_ENABLED(CONFIG_OF)
|
||||
struct device_node *of_node;
|
||||
#endif
|
||||
#endif /* CONFIG_OF */
|
||||
void *dev_priv;
|
||||
u32 flag;
|
||||
void *mst_ctx;
|
||||
@@ -116,14 +117,14 @@ struct dp_aux_bridge {
|
||||
*/
|
||||
int dp_aux_add_bridge(struct dp_aux_bridge *bridge);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
#if IS_ENABLED(CONFIG_OF)
|
||||
/**
|
||||
* of_dp_aux_find_bridge - Find registered DP aux bridge
|
||||
* @np: device node pointer to the bridge
|
||||
* return: DP aux bridge pointer, NULL if not found
|
||||
*/
|
||||
struct dp_aux_bridge *of_dp_aux_find_bridge(struct device_node *np);
|
||||
#endif
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
#endif /* _DP_AUX_BRIDGE_H_ */
|
||||
|
||||
|
Reference in New Issue
Block a user