From patchwork Wed Nov 12 14:40:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 5289721 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5FF04C11AC for ; Wed, 12 Nov 2014 14:41:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BE08201CD for ; Wed, 12 Nov 2014 14:41:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1697B201B4 for ; Wed, 12 Nov 2014 14:41:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2089B265770; Wed, 12 Nov 2014 15:41:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id F28202656EB; Wed, 12 Nov 2014 15:41:09 +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 7DEF82656EE; Wed, 12 Nov 2014 15:41:08 +0100 (CET) Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by alsa0.perex.cz (Postfix) with ESMTP id 65582265675 for ; Wed, 12 Nov 2014 15:41:00 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 106) id E31D574C; Wed, 12 Nov 2014 15:40:58 +0100 (CET) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 74D3C746; Wed, 12 Nov 2014 15:40:58 +0100 (CET) From: Thomas Petazzoni To: Brian Austin , Paul Handrigan , Liam Girdwood , Mark Brown Date: Wed, 12 Nov 2014 15:40:44 +0100 Message-Id: <1415803244-7010-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.0.0 Cc: Lior Amsalem , Thomas Petazzoni , alsa-devel@alsa-project.org, Tawfik Bayouk , stable@vger.kernel.org, Nadav Haklai , "Arnaud Patard \(Rtp\)" , Ezequiel Garcia , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCHv2] ASoC: cs42l51: re-hook of_match_table pointer 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP In commit a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver"), the I2C part of the CS42L51 was moved to a separate file, but the definition of the of_device_id array was left in the driver file itself, no longer connected to the platform_driver structure using the .of_match_table pointer. This commit exports the of_device_id array in cs42l51, and uses it as .of_match_able in cs42l51-i2c.c. This solution was suggested by Brian Austin. Fixes: a1253ef6d3fa ("ASoC: cs42l51: split i2c from codec driver") Cc: # v3.16+ Cc: Arnaud Patard (Rtp) Cc: Brian Austin Signed-off-by: Thomas Petazzoni Acked-by: Brian Austin --- sound/soc/codecs/cs42l51-i2c.c | 1 + sound/soc/codecs/cs42l51.c | 4 +++- sound/soc/codecs/cs42l51.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) --- Changes since v1: - Instead of moving the of_device_id array definition to the I2C specific file, keep it in the core file, and export it so it can be used by the I2C specific file. Suggested by Brian Austin. diff --git a/sound/soc/codecs/cs42l51-i2c.c b/sound/soc/codecs/cs42l51-i2c.c index cee51ae..c40428f 100644 --- a/sound/soc/codecs/cs42l51-i2c.c +++ b/sound/soc/codecs/cs42l51-i2c.c @@ -46,6 +46,7 @@ static struct i2c_driver cs42l51_i2c_driver = { .driver = { .name = "cs42l51", .owner = THIS_MODULE, + .of_match_table = cs42l51_of_match, }, .probe = cs42l51_i2c_probe, .remove = cs42l51_i2c_remove, diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index 09488d9..669c38f 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -558,11 +558,13 @@ error: } EXPORT_SYMBOL_GPL(cs42l51_probe); -static const struct of_device_id cs42l51_of_match[] = { +const struct of_device_id cs42l51_of_match[] = { { .compatible = "cirrus,cs42l51", }, { } }; MODULE_DEVICE_TABLE(of, cs42l51_of_match); +EXPORT_SYMBOL_GPL(cs42l51_of_match); + MODULE_AUTHOR("Arnaud Patard "); MODULE_DESCRIPTION("Cirrus Logic CS42L51 ALSA SoC Codec Driver"); MODULE_LICENSE("GPL"); diff --git a/sound/soc/codecs/cs42l51.h b/sound/soc/codecs/cs42l51.h index 8c55bf3..0ca8054 100644 --- a/sound/soc/codecs/cs42l51.h +++ b/sound/soc/codecs/cs42l51.h @@ -22,6 +22,7 @@ struct device; extern const struct regmap_config cs42l51_regmap; int cs42l51_probe(struct device *dev, struct regmap *regmap); +extern const struct of_device_id cs42l51_of_match[]; #define CS42L51_CHIP_ID 0x1B #define CS42L51_CHIP_REV_A 0x00