From patchwork Fri Sep 1 06:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13372123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F256CA0FE6 for ; Fri, 1 Sep 2023 07:03:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 69E29AE9; Fri, 1 Sep 2023 09:03:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 69E29AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693551830; bh=aF/XXG0s6sA5xxzCPUnxbKnft9a3KHOxH2r2KHH5IsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=M/F/gvnFNIrwtfMmVOyZROvqV4zGgKXvKb6Ja+Qxy0GIBmUSiiLE3HUpaSoptf9Hy SgvZv3nXOPq4qO0ktMt1lg1EsdcWZLd6VUAU+aSc+OC0n+LMQCoct+Ux+nxMLe6+Wx WXJo01+NGsJzoZmhSilOa8J73n6I4jGddik844TQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44A56F8023B; Fri, 1 Sep 2023 09:02:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AF9AAF800D1; Fri, 1 Sep 2023 09:02:49 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 11C13F8023B; Fri, 1 Sep 2023 09:02:46 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 5CD97F800D1 for ; Fri, 1 Sep 2023 09:00:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5CD97F800D1 X-IronPort-AV: E=Sophos;i="6.02,218,1688396400"; d="scan'208";a="178409324" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Sep 2023 16:00:03 +0900 Received: from localhost.localdomain (unknown [10.226.92.203]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D1255400264E; Fri, 1 Sep 2023 15:59:59 +0900 (JST) From: Biju Das To: Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Liam Girdwood , Mark Brown , Charles Keepax , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Andy Shevchenko , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH v4 1/3] ASoC: wm8580: Simplify probe() Date: Fri, 1 Sep 2023 07:59:50 +0100 Message-Id: <20230901065952.18760-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> References: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Message-ID-Hash: JAPL3XXISMXL6O5HJZBCJDRC3XGQEHFK X-Message-ID-Hash: JAPL3XXISMXL6O5HJZBCJDRC3XGQEHFK X-MailFrom: biju.das.jz@bp.renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Simplify probe() by replacing of_match_device->i2c_get_match_data() and extend matching support for ID table. While at it, remove comma in the terminator entry and simplify probe() by replacing dev_err()->dev_err_probe(). Signed-off-by: Biju Das Acked-by: Charles Keepax Reviewed-by: Andy Shevchenko --- v3->v4: * No change. v2->v3: * Added Rb tag from Andy. * Restored OF table postion and moved in patch#2 v1->v2: * Added Ack from Charles Keepax. * Removed comma in the terminator entry. * Restored original error code -EINVAL --- sound/soc/codecs/wm8580.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 6d22f7d40ec2..826c39ec4a1e 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -997,7 +997,6 @@ MODULE_DEVICE_TABLE(of, wm8580_of_match); static int wm8580_i2c_probe(struct i2c_client *i2c) { - const struct of_device_id *of_id; struct wm8580_priv *wm8580; int ret, i; @@ -1022,14 +1021,9 @@ static int wm8580_i2c_probe(struct i2c_client *i2c) i2c_set_clientdata(i2c, wm8580); - of_id = of_match_device(wm8580_of_match, &i2c->dev); - if (of_id) - wm8580->drvdata = of_id->data; - - if (!wm8580->drvdata) { - dev_err(&i2c->dev, "failed to find driver data\n"); - return -EINVAL; - } + wm8580->drvdata = i2c_get_match_data(i2c); + if (!wm8580->drvdata) + return dev_err_probe(&i2c->dev, -EINVAL, "failed to find driver data\n"); ret = devm_snd_soc_register_component(&i2c->dev, &soc_component_dev_wm8580, wm8580_dai, ARRAY_SIZE(wm8580_dai)); From patchwork Fri Sep 1 06:59:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13372122 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE9CDCA0FE6 for ; Fri, 1 Sep 2023 07:03:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8A00584B; Fri, 1 Sep 2023 09:02:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A00584B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693551807; bh=rwgB3w7qrbXANmv7nuGlPQxSIYnnNzTNtVIowcWM4ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=dUSriJizibpgrKR9y/vbfrTHXa6r7hZ61SXe8ve/4wcdcsyDjGZQpU9sCMEfrkQpS THr7cOdoaRCLaUZH4DlQD465ubuzLbc0njXHMZNHyeAfa/78wdyTopomN8qNnwmhK0 web17+eRHgxB74la7JRJGH6kN9aFKQon6skZGjgk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 251D8F80094; Fri, 1 Sep 2023 09:01:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A99A2F80536; Fri, 1 Sep 2023 09:01:47 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1436CF8023B; Fri, 1 Sep 2023 09:00:16 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id A69B4F80155 for ; Fri, 1 Sep 2023 09:00:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A69B4F80155 X-IronPort-AV: E=Sophos;i="6.02,218,1688396400"; d="scan'208";a="178409350" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Sep 2023 16:00:07 +0900 Received: from localhost.localdomain (unknown [10.226.92.203]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 130DE40116D0; Fri, 1 Sep 2023 16:00:03 +0900 (JST) From: Biju Das To: Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Liam Girdwood , Mark Brown , Charles Keepax , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Andy Shevchenko , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH v4 2/3] ASoC: wm8580: Remove trailing comma in the terminator entry Date: Fri, 1 Sep 2023 07:59:51 +0100 Message-Id: <20230901065952.18760-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> References: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Message-ID-Hash: MQRUZQUOOUWQ32UXF3G7CTLTNW5224P6 X-Message-ID-Hash: MQRUZQUOOUWQ32UXF3G7CTLTNW5224P6 X-MailFrom: biju.das.jz@bp.renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Remove trailing comma in the terminator entry for OF table. Signed-off-by: Biju Das Acked-by: Charles Keepax Reviewed-by: Andy Shevchenko --- v4: * New patch --- sound/soc/codecs/wm8580.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 826c39ec4a1e..ba47b01f13e7 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -991,7 +991,7 @@ static const struct wm8580_driver_data wm8581_data = { static const struct of_device_id wm8580_of_match[] = { { .compatible = "wlf,wm8580", .data = &wm8580_data }, { .compatible = "wlf,wm8581", .data = &wm8581_data }, - { }, + { } }; MODULE_DEVICE_TABLE(of, wm8580_of_match); From patchwork Fri Sep 1 06:59:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13372121 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7B84FCA0FE8 for ; Fri, 1 Sep 2023 07:03:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A43E1A4C; Fri, 1 Sep 2023 09:02:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A43E1A4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1693551810; bh=MdehHleLjDARyPc+Ib3vigZCG/qA1CNQAr3VjBRIqMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cmYXFfQJ+PQGkbfGA4fPb+J7VvLiXgSBslMq0kZ4VG9yHhny5v5CKAxyRNUnZxTVA zaosk5xs3UJ2zJLGR13pYBVGTTUt5Ru/z6wALiVHN0wj8tFtYr1SzEm4Y0t8Npfldu Tw3Su3xuoBgC/lQ3Xd1QEzT+LR4b0WjTvPmz7FSM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7AE58F80568; Fri, 1 Sep 2023 09:01:50 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3B97CF80568; Fri, 1 Sep 2023 09:01:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 00767F80236; Fri, 1 Sep 2023 09:00:17 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id E76B0F80094 for ; Fri, 1 Sep 2023 09:00:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E76B0F80094 X-IronPort-AV: E=Sophos;i="6.02,218,1688396400"; d="scan'208";a="178409384" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Sep 2023 16:00:12 +0900 Received: from localhost.localdomain (unknown [10.226.92.203]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 76C264008C5C; Fri, 1 Sep 2023 16:00:08 +0900 (JST) From: Biju Das To: Jaroslav Kysela , Takashi Iwai Cc: Biju Das , Liam Girdwood , Mark Brown , Charles Keepax , =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= , Andy Shevchenko , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Biju Das Subject: [PATCH v4 3/3] ASoC: wm8580: Move OF table Date: Fri, 1 Sep 2023 07:59:52 +0100 Message-Id: <20230901065952.18760-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> References: <20230901065952.18760-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Message-ID-Hash: 4P2FZU4YBIT7GYHSXEFJFMI4PM6X5562 X-Message-ID-Hash: 4P2FZU4YBIT7GYHSXEFJFMI4PM6X5562 X-MailFrom: biju.das.jz@bp.renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Move OF table near to the user. Signed-off-by: Biju Das Acked-by: Charles Keepax --- v3->v4: * Created patch#2 for removing trailing comma in the terminator entry for OF table. v3: * New patch. --- sound/soc/codecs/wm8580.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index ba47b01f13e7..28c0ba348634 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -988,13 +988,6 @@ static const struct wm8580_driver_data wm8581_data = { .num_dacs = 4, }; -static const struct of_device_id wm8580_of_match[] = { - { .compatible = "wlf,wm8580", .data = &wm8580_data }, - { .compatible = "wlf,wm8581", .data = &wm8581_data }, - { } -}; -MODULE_DEVICE_TABLE(of, wm8580_of_match); - static int wm8580_i2c_probe(struct i2c_client *i2c) { struct wm8580_priv *wm8580; @@ -1031,6 +1024,13 @@ static int wm8580_i2c_probe(struct i2c_client *i2c) return ret; } +static const struct of_device_id wm8580_of_match[] = { + { .compatible = "wlf,wm8580", .data = &wm8580_data }, + { .compatible = "wlf,wm8581", .data = &wm8581_data }, + { } +}; +MODULE_DEVICE_TABLE(of, wm8580_of_match); + static const struct i2c_device_id wm8580_i2c_id[] = { { "wm8580", (kernel_ulong_t)&wm8580_data }, { "wm8581", (kernel_ulong_t)&wm8581_data },