From patchwork Mon Jan 14 09:55:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 10761861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BABD214E5 for ; Mon, 14 Jan 2019 09:55:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB32B28A75 for ; Mon, 14 Jan 2019 09:55:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EC5428ADD; Mon, 14 Jan 2019 09:55:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F75828A75 for ; Mon, 14 Jan 2019 09:55:55 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 79CC2266AA9; Mon, 14 Jan 2019 10:55:53 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CDD35266ABC; Mon, 14 Jan 2019 10:55:50 +0100 (CET) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by alsa0.perex.cz (Postfix) with ESMTP id 1E701266A73 for ; Mon, 14 Jan 2019 10:55:47 +0100 (CET) Received: by mail-lf1-f67.google.com with SMTP id c16so15097050lfj.8 for ; Mon, 14 Jan 2019 01:55:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kiHdA9QkJRvfjwHTIrMx6nrkjWZbNgwvVi/jDVnFEGU=; b=aQYq2n9CIgX+UUZJoi1/zKIjsIVGr6rKv7tinq2DX+ymRYSvAvjKbbFn3h+NBG/ZRh ZO5NPMlvMJJSQ4IJRrc9DQmOXha7I6lw7tns78lpbnD02CEAnl5dQSx7gUTkckTuw8Q5 yBvUGeV5cYdFSUQxesN0EaQAaUE4Hd/WrRdGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kiHdA9QkJRvfjwHTIrMx6nrkjWZbNgwvVi/jDVnFEGU=; b=MylJNVFVh1idDK+1sfLGoQyeDo1WhGIeCVIvCnbGR0RnFCboRjj+w5RFQ38dMrANFN MqF+lmvpNzcmROZVh9F5vjWFujWD7E/INf+6IUwilPMW0eHwY6UWVGbATAwtVY/6ayun 3i3YxWIJjpe5wpakCdFf8r7smjTo6peu60LvTDIZ/X00DLZsDy3xK2pNu37GBGlk9Mow tbQcA+AFXoL+8vY3cQ/3Wgu9n4CKuz3RoHtVlPEfOl35calVeCO0h638HhDaOZ2HmyyE HRRsKPx+5vOeg/8BF/4Al4AB3FkYccluZMlsH8E4LWSFkJ4L8Zf/v2uZ8ecCw3Vlknqr yMww== X-Gm-Message-State: AJcUukc3sbjya6NhRLOJgcpbvlkutB39AeoNTXNKxxucZjb17lGRyG3i 4jUK1c1JUPxdzzqlhLMoyX8z7A== X-Google-Smtp-Source: ALg8bN4VLCfOcM3i+FpoNVfMM/WYcR7cCUZpIHhzRYHgHr5Wiab0rIZanzF7Mi51wYEssT4PyBmySw== X-Received: by 2002:a19:7006:: with SMTP id h6mr13504722lfc.147.1547459746705; Mon, 14 Jan 2019 01:55:46 -0800 (PST) Received: from localhost (c-573670d5.07-21-73746f28.bbcust.telenor.se. [213.112.54.87]) by smtp.gmail.com with ESMTPSA id f16-v6sm17516494lji.88.2019.01.14.01.55.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 01:55:46 -0800 (PST) From: Anders Roxell To: perex@perex.cz, tiwai@suse.com, brian.austin@cirrus.com, Paul.Handrigan@cirrus.com, lgirdwood@gmail.com, broonie@kernel.org Date: Mon, 14 Jan 2019 10:55:40 +0100 Message-Id: <20190114095540.22956-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Anders Roxell , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/3] ASoC: cs4341: fix waring unused-function X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The driver cs4341 can be built with SPI and/or I2C, but it has to be one of them at least. When I2C is set as a module we see the warning below: sound/soc/codecs/cs4341.c:213:12: warning: ‘cs4341_probe’ defined but not used [-Wunused-function] static int cs4341_probe(struct device *dev) ^~~~~~~~~~~~ Rework so that we use IS_ENABLED instead of defined. Also change so SND_SOC_CS4341 depends on SND_SOC_I2C_AND_SPI to we dont' get a link error when SND_SOC_CS4341=y, I2C=m and REGMAP_I2C=m is set. Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell --- sound/soc/codecs/Kconfig | 2 +- sound/soc/codecs/cs4341.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 87cb9c51e6f5..87ecb38e57f4 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -546,7 +546,7 @@ config SND_SOC_CS43130 config SND_SOC_CS4341 tristate "Cirrus Logic CS4341 CODEC" - depends on I2C || SPI_MASTER + depends on SND_SOC_I2C_AND_SPI select REGMAP_I2C if I2C select REGMAP_SPI if SPI_MASTER diff --git a/sound/soc/codecs/cs4341.c b/sound/soc/codecs/cs4341.c index d2e616a89fd4..ade7477d04f1 100644 --- a/sound/soc/codecs/cs4341.c +++ b/sound/soc/codecs/cs4341.c @@ -223,7 +223,7 @@ static int cs4341_probe(struct device *dev) &cs4341_dai, 1); } -#if defined(CONFIG_I2C) +#if IS_ENABLED(CONFIG_I2C) static int cs4341_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -317,7 +317,7 @@ static int __init cs4341_init(void) { int ret = 0; -#if defined(CONFIG_I2C) +#if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&cs4341_i2c_driver); if (ret) return ret; @@ -332,7 +332,7 @@ module_init(cs4341_init); static void __exit cs4341_exit(void) { -#if defined(CONFIG_I2C) +#if IS_ENABLED(CONFIG_I2C) i2c_del_driver(&cs4341_i2c_driver); #endif #if defined(CONFIG_SPI_MASTER)