From: 黄涛 Date: Tue, 7 Dec 2010 10:44:26 +0000 (+0800) Subject: adc: 当CONFIG_ADC未配置,依赖于adc的代码依然可以编译 X-Git-Tag: firefly_0821_release~10981^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=60cfb8b2919603be05827d13fab5e8988b251f6c;p=firefly-linux-kernel-4.4.55.git adc: 当CONFIG_ADC未配置,依赖于adc的代码依然可以编译 --- diff --git a/include/linux/adc.h b/include/linux/adc.h index 47df46e5862f..fcef9923f78b 100755 --- a/include/linux/adc.h +++ b/include/linux/adc.h @@ -61,6 +61,7 @@ extern void adc_free_host(struct adc_host *adc); extern void adc_core_irq_handle(struct adc_host *adc); +#ifdef CONFIG_ADC extern struct adc_client *adc_register(int chn, void (*callback)(struct adc_client *, void *, int), void *callback_param); @@ -68,6 +69,17 @@ extern void adc_unregister(struct adc_client *client); extern int adc_sync_read(struct adc_client *client); extern int adc_async_read(struct adc_client *client); +#else +static inline struct adc_client *adc_register(int chn, + void (*callback)(struct adc_client *, void *, int), + void *callback_param) +{ + return NULL; +} +static inline void adc_unregister(struct adc_client *client) {} +static inline int adc_sync_read(struct adc_client *client) { return -EINVAL; } +static inline int adc_async_read(struct adc_client *client) { return -EINVAL; } +#endif #endif