From 7885342cc2727e2e9acae1597ebc88bedfea8464 Mon Sep 17 00:00:00 2001 From: Vaibhav Agarwal Date: Wed, 13 Jan 2016 14:07:49 -0700 Subject: [PATCH] greybus: audio: Build audio module conditionally Added CONFIG_XXX flag check before compiling audio module. Once we add dynamic DAI link registration from audio driver, this check wil be required to avoid compilation failures with other kernel revisions. Also, renamed header file to better align with .c file name. Signed-off-by: Vaibhav Agarwal Signed-off-by: Mark Greer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/Makefile | 3 +++ drivers/staging/greybus/audio_codec.c | 2 +- drivers/staging/greybus/{audio.h => audio_codec.h} | 9 +++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename drivers/staging/greybus/{audio.h => audio_codec.h} (97%) diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile index 4ebdc6b9c89f..6759d684027c 100644 --- a/drivers/staging/greybus/Makefile +++ b/drivers/staging/greybus/Makefile @@ -47,6 +47,9 @@ obj-m += gb-raw.o obj-m += gb-es2.o obj-m += gb-arche.o obj-m += gb-audio-codec.o +ifeq ($(CONFIG_SND_SOC_DYNAMIC_DAILINK),y) + obj-m += gb-audio-codec.o +endif obj-m += gb-camera.o obj-m += gb-audio-gb.o obj-m += gb-audio-apbridgea.o diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 2bc23095ffd0..826604ae64df 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -7,7 +7,7 @@ */ #include -#include "audio.h" +#include "audio_codec.h" static int gbcodec_event_spk(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) diff --git a/drivers/staging/greybus/audio.h b/drivers/staging/greybus/audio_codec.h similarity index 97% rename from drivers/staging/greybus/audio.h rename to drivers/staging/greybus/audio_codec.h index fca60af3ddc1..f8597b3de808 100644 --- a/drivers/staging/greybus/audio.h +++ b/drivers/staging/greybus/audio_codec.h @@ -6,10 +6,8 @@ * Released under the GPLv2 only. */ -#ifndef __LINUX_GBAUDIO_H -#define __LINUX_GBAUDIO_H - -#ifdef __KERNEL__ +#ifndef __LINUX_GBAUDIO_CODEC_H +#define __LINUX_GBAUDIO_CODEC_H #include @@ -145,5 +143,4 @@ extern int gb_audio_apbridgea_start_rx(struct gb_connection *connection, extern int gb_audio_apbridgea_stop_rx(struct gb_connection *connection, __u16 i2s_port); -#endif /* __KERNEL__ */ -#endif /* __LINUX_GBAUDIO_H */ +#endif /* __LINUX_GBAUDIO_CODEC_H */ -- 2.20.1