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: 155415 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3467187jaa; Mon, 14 Jan 2019 01:55:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mYFidFMzOeFKTurouo8/GJGRDM8yh9VjsTCltxrorKmZ0O0NIgWcy8iGk28gSQv9SWqNn X-Received: by 2002:a63:f844:: with SMTP id v4mr21951096pgj.82.1547459750940; Mon, 14 Jan 2019 01:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547459750; cv=none; d=google.com; s=arc-20160816; b=DU1ki0ahddgnf7EWfHQH7CYS3T9x/z3fjm1Y0MPL7iCdXhmKcNnc4ZWEiS51wIcqfC fq0UqVAKIqM6lj3IXAebENDyakAb8l8Z//8p6K6eJkmcUBog7yKB8MKnGlTj0PX4xR87 VhJz9VhTrrp87dt/RATFsFMk9+B1RzmOi2g1/DNwEe6e/Pzjd7tZy97BhU9zGOE94NkW g/r8sJVn1lHAF6rL3rilML6Fd9KpHOZOViRkOH297jhyhc436H6wgi5ZnVyEkEwzBTS+ jzMZcvgqz06AYo2GVhgljqNZXeyfRERx6wJUjP2K0uR0cf51XhfAswuM3y+1TIvk8QBX XIjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kiHdA9QkJRvfjwHTIrMx6nrkjWZbNgwvVi/jDVnFEGU=; b=neePSVHRaCgxEqX1zvCxgInbJ2Ht5vWbURliWyjlKxvSzwhTEGXFf2SRXV1MZ+X+Bm Rz1jbkokODpKVDyK9ohdMJdJz7+lH1e6Q8J5egyJ7GhvMlbVdFyM6hB242/ejti8X9Pe QiyWKTBdloEAqWzW5Rvor8uPth+CtIPBf8NhX+5EbBIqQSA3pBH2IDw+sx7B3pMKq7KJ qx37Z2UuU8c0ThyFyNcwQKFgmnz8daXlOiAFHZAqIO0ejEo1kW4KyZLCr/ooGKVHAHCj 1m1WmOy6Awpl4VTVdpilmcBdV2A4o+j6hKAUOjrLefzRrL2w1XjFdMlhFqWdujgbVSNj slHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aQYq2n9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x61si7935964plb.303.2019.01.14.01.55.50; Mon, 14 Jan 2019 01:55:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aQYq2n9C; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbfANJzt (ORCPT + 31 others); Mon, 14 Jan 2019 04:55:49 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44980 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfANJzt (ORCPT ); Mon, 14 Jan 2019 04:55:49 -0500 Received: by mail-lf1-f65.google.com with SMTP id z13so15085687lfe.11 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=joMVUchO76Gp7kcL1qTkwvKdczs19ZGnICuNFojwhBuIrEjoAcFwmFga+NLHSRgUv1 5b5aZ4eGvpEfndNHGpieYrnws75UW9Gr2BLPCtBoFH87F9oRPn+6ifVnsptYgWzxQVzC xKsLj+2Apv8ykAsltRg7fBVc3ResRrOnla48d6NGjajm3H4lO8nsQgf8GTZ/Ji1g6vB3 3e9EjD2TJwRmtzZLQ7LDg1bsV4zyY6jUwAmLMNFZ9cihXr9+c7VV6v5BOkYvVsY2vzWQ W6AUaBXvfDQ/e6muDuOFg4dy27LmUmoM85hyd5a0uyfZEV8vzSO+vow1wUWHdoWCdq0J u3rQ== X-Gm-Message-State: AJcUukejyMjPJ0pUJjDplL5f6VrUSCSkJyuJ9FqLJs3B+eQ/xCzliHoK eKcJAs/vyjLt7k5M5uBD5h6uZw== 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 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH 1/3] ASoC: cs4341: fix waring unused-function 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.19.2 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)