From patchwork Wed Nov 21 02:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10691539 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 47E2013BF for ; Wed, 21 Nov 2018 02:09:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 324D52B196 for ; Wed, 21 Nov 2018 02:09:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2677C2B19B; Wed, 21 Nov 2018 02:09:13 +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 7B2AA2B196 for ; Wed, 21 Nov 2018 02:09:12 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6659626796E; Wed, 21 Nov 2018 03:09:11 +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 D8372267972; Wed, 21 Nov 2018 03:09:09 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410138.outbound.protection.outlook.com [40.107.141.138]) by alsa0.perex.cz (Postfix) with ESMTP id 6353526796E for ; Wed, 21 Nov 2018 03:09:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hgSIC7ntCWNBqg6kpwY0TIrRt9LYCKxgt5tklBiNOyo=; b=mm27CcvjWShhMtGZebM9jtva5RcR6B/q8oeeqW7GK42ID3YD8m8FE+kfJy2inC32E7dROssF4OYV5cnC3C+Eq1S9Ft/TzoRZ5DV5nQrIiAx3Hmv5lugA2FQcTTRk+w7+HkcM748QbOFe2OtvPyxGXS7UCg7AuDjEOcVpEZZ9VWE= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB4303.jpnprd01.prod.outlook.com (20.179.173.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.26; Wed, 21 Nov 2018 02:08:59 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 02:08:59 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Thread-Index: AQHUgT8q6m+GCtHrTEyM1fku/GZQlw== Date: Wed, 21 Nov 2018 02:08:59 +0000 Message-ID: <87va4rp4vj.wl-kuninori.morimoto.gx@renesas.com> References: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0143.jpnprd01.prod.outlook.com (2603:1096:404:2d::35) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB4303; 20:hf9/hTgEC+BqOnLieNSyE9Tyb8X8dhKMNWD7VZFaCTgn8PeNDFxzp7n2pA5qts5a39sFgdu+w3o2UdkgrVxPp0FMq+DXfyAzuK9hl8CjdGdYT5gWPLonkTVhaGVHfsxcZWIqQoG59H+Fz2b7ewgyKdS9mLvuD/gUhvu8jAYUp84= x-ms-office365-filtering-correlation-id: c0875699-744b-4e34-794b-08d64f564c75 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB4303; x-ms-traffictypediagnostic: TYAPR01MB4303: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB4303; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB4303; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(136003)(396003)(39840400004)(366004)(199004)(189003)(53936002)(2906002)(66066001)(105586002)(106356001)(8676002)(305945005)(81166006)(81156014)(186003)(6916009)(102836004)(6116002)(3846002)(86362001)(446003)(6506007)(386003)(52116002)(256004)(97736004)(76176011)(99286004)(36756003)(316002)(71190400001)(5660300001)(71200400001)(2900100001)(25786009)(478600001)(14454004)(4326008)(6512007)(68736007)(7736002)(8936002)(11346002)(486006)(2616005)(6486002)(476003)(6436002)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB4303; H:TYAPR01MB3328.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: XD1Pumn2htjVEbif6xToh7n/6qynh7XXEkwe90/5zTDzU3jOwGfxQ1HpRBjB2GsArAhbd3jbpvYfVZvZglMQsKjUcAwEAOsSmL4rIZ8Rl/bli44yVIb7g/Eq2tG9AFTwCUfy2nO04FENVJd3wV74pQUugX/ilnLwzS7iMhy3T8HeK6jNSdfcEDerDBRWNbVXEKH0Yi8Beowyh5BWPoFuChcCcyKcYGNk8T4KFIvjB63Y/mHrOgWlcbG9vGsO1RTE3+SN34zzM+fINA8LZhpL8yjhIXPoqgTSw8h4ehjPh6JrP3Ap+hhS/2Zv3HW+oJvactGyVOH1BL7UNfcqH1/nNlblEuG5oUNj9pYmbzfFgGE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <35C5A329CF7ED4458EC5262DB46F4FC5@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0875699-744b-4e34-794b-08d64f564c75 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 02:08:59.0954 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB4303 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() 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 From: Kuninori Morimoto asoc_simple_card_clk_register() is used but only 1 user, and very pointless code. Let's remove it. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card-utils.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index a191d59..dcac45dad 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -151,12 +151,6 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); -static void asoc_simple_card_clk_register(struct asoc_simple_dai *dai, - struct clk *clk) -{ - dai->clk = clk; -} - int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai) { return clk_prepare_enable(dai->clk); @@ -200,7 +194,7 @@ int asoc_simple_card_parse_clk(struct device *dev, if (!IS_ERR(clk)) { simple_dai->sysclk = clk_get_rate(clk); - asoc_simple_card_clk_register(simple_dai, clk); + simple_dai->clk = clk; } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { simple_dai->sysclk = val; } else { From patchwork Wed Nov 21 02:09:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10691543 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 7EC5C14E2 for ; Wed, 21 Nov 2018 02:09:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 693C22B19D for ; Wed, 21 Nov 2018 02:09:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D8D32B1A3; Wed, 21 Nov 2018 02:09:25 +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 BAA252B19D for ; Wed, 21 Nov 2018 02:09:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B8786267947; Wed, 21 Nov 2018 03:09:23 +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 98ADE267A7E; Wed, 21 Nov 2018 03:09:21 +0100 (CET) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (mail-eopbgr1410108.outbound.protection.outlook.com [40.107.141.108]) by alsa0.perex.cz (Postfix) with ESMTP id E9990267936 for ; Wed, 21 Nov 2018 03:09:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cU35TJMl9JdyGZlG56o7F+tDQotjiavkAEJdNnjxV8s=; b=VZJIZlPHTvv8rfYpo6//ojSNviIJzZO8vy+CNjnnxkJYeFdQ/seaAoXdbIl3H5tBFCuGk7TJAgLuezwoXuog/rILZdfP5Dbhrq+tNbW5w9BJXLK7vF42aoZiZXKO0yAQX1g3/KpqIwBWTR79y5SbfLbjSN4FDZ8PzftsgxQlkSk= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB4303.jpnprd01.prod.outlook.com (20.179.173.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.26; Wed, 21 Nov 2018 02:09:16 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 02:09:16 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() Thread-Index: AQHUgT80423diPJF0UifEoVQZMex0Q== Date: Wed, 21 Nov 2018 02:09:16 +0000 Message-ID: <87tvkbp4v0.wl-kuninori.morimoto.gx@renesas.com> References: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TY2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:404:56::22) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB4303; 20:voJzMul6OjqX3J/gUu/EGB4dIifQR4Kk6YXT9LXAIgtsctVJjR/Ta9jVI8hgSM3nrdXOJBchIIcmkt7qlJ01Fn7MavyBB/hY2bcmCVXVEOFrm5uAnmOeUOtHsMZMgj/CeHuqOgdrBQ1IWVZJUMbpXnoYZngv16EqwOxTokqzKN8= x-ms-office365-filtering-correlation-id: bab52fb0-3f2b-465d-0623-08d64f5656fd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB4303; x-ms-traffictypediagnostic: TYAPR01MB4303: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231442)(944501410)(52105112)(93006095)(93001095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB4303; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB4303; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(376002)(136003)(396003)(39840400004)(366004)(199004)(189003)(53936002)(2906002)(66066001)(105586002)(106356001)(8676002)(305945005)(81166006)(81156014)(186003)(6916009)(102836004)(6116002)(3846002)(86362001)(446003)(6506007)(386003)(52116002)(256004)(97736004)(76176011)(99286004)(36756003)(316002)(71190400001)(5660300001)(71200400001)(2900100001)(25786009)(478600001)(14454004)(4326008)(6512007)(68736007)(7736002)(8936002)(11346002)(486006)(2616005)(6486002)(476003)(6436002)(26005)(21314003); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB4303; H:TYAPR01MB3328.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: msLsst3A+2t6yF0bkLJyWNR1ojCbtn3cKP1ucEka/+TT+mlN8MZQSl4D1dX6QHS3rmyvNJi/0m1Kt58A9+Yg1H/SPJFxV609MCRUSVgKnYOQHG0mS2nrc6Bgi1xEYhT856rbbiV4fiO5YKq3f6FJXMOfYNi7PLsx7Xla4Nwi15EjKgKIpgkRIywa26PDXVMr2yPabBfr2OTKOYF8Nu+3DVuXuezYvSyb/0Qt8tB6dypOLJz0uTKoSlu0L52ZNNuz/zi1XYQYHVdT0xgz6X5yOH31y2IMF6TbbdsXJULjuUgXxrxiF3EO0zCZUWOWNJHL3Pc9T8ag8PN0wUKy3XbCiAXQsCxqw52KzZLkVzurqA4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <63591ECD4526174FB3C10BCB2DC45FD9@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bab52fb0-3f2b-465d-0623-08d64f5656fd X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 02:09:16.6899 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB4303 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() 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 From: Kuninori Morimoto If simple-card-utils accept NULL pointer on asoc_simple_card_xxx(), each driver code will be more simple. Let's accept NULL pointer. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/simple-card-utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index dcac45dad..2fe7ea2 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -153,13 +153,17 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai) { - return clk_prepare_enable(dai->clk); + if (dai) + return clk_prepare_enable(dai->clk); + + return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_clk_enable); void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai) { - clk_disable_unprepare(dai->clk); + if (dai) + clk_disable_unprepare(dai->clk); } EXPORT_SYMBOL_GPL(asoc_simple_card_clk_disable); @@ -345,6 +349,9 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, { int ret; + if (!simple_dai) + return 0; + if (simple_dai->sysclk) { ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, simple_dai->clk_direction); From patchwork Wed Nov 21 02:10:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10691549 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 4500213AD for ; Wed, 21 Nov 2018 02:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA2D2B1E3 for ; Wed, 21 Nov 2018 02:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23F452B1E5; Wed, 21 Nov 2018 02:11:02 +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 7533F2B1E3 for ; Wed, 21 Nov 2018 02:11:01 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 423EF267947; Wed, 21 Nov 2018 03:11:00 +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 44B3526796A; Wed, 21 Nov 2018 03:10:58 +0100 (CET) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400109.outbound.protection.outlook.com [40.107.140.109]) by alsa0.perex.cz (Postfix) with ESMTP id D6CED267936 for ; Wed, 21 Nov 2018 03:10:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mtgug2WzRaT8k7jXReh/z55yH/Ahi84AyRAi1nXNuCY=; b=M0Qof4nGVQQ/0qoOAEyjonVAzEdknS3sOXEIVV//KKmKVg7lRo5x0rOesJi5/WxorMASFWdoVih7W+hTCxx2IXJvJFFpBZ0FTcF60YWYP64n2Vt4e6PI8mehXHit65MTJwWJm9eb3nxWAoywiEPZlu7PP1PBM1pDV8pKl+O8leo= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB3936.jpnprd01.prod.outlook.com (20.178.139.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.24; Wed, 21 Nov 2018 02:10:52 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 02:10:52 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Thread-Index: AQHUgT9tyefJqCZntEWvHm+PkImSTg== Date: Wed, 21 Nov 2018 02:10:51 +0000 Message-ID: <87sgzvp4se.wl-kuninori.morimoto.gx@renesas.com> References: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0111.jpnprd01.prod.outlook.com (2603:1096:404:2a::27) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB3936; 20:4bMPcstquJSMUrLM758KwGgVoCay5nViU59fhvjWikQJFFifL7cVUMvzX7Y9HIoR8SCsvWduQvZOJGikzcHaNG0fk/ZZ98Zka98d9OsOY1elIBkZpHZkrjmfSSiEDyQlElqFeGWOCXfLtR39oNFtZBDL83gYemU+qNYN05L3qeM= x-ms-office365-filtering-correlation-id: 13a6208d-0a36-4ece-d77f-08d64f568fc0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB3936; x-ms-traffictypediagnostic: TYAPR01MB3936: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB3936; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB3936; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(136003)(376002)(346002)(396003)(189003)(199004)(5660300001)(25786009)(2906002)(6116002)(6512007)(3846002)(7736002)(386003)(53936002)(6506007)(305945005)(81166006)(8936002)(8676002)(81156014)(4326008)(14454004)(97736004)(36756003)(2900100001)(71200400001)(478600001)(71190400001)(316002)(256004)(486006)(11346002)(446003)(6916009)(99286004)(52116002)(76176011)(106356001)(86362001)(6436002)(26005)(186003)(2616005)(476003)(6486002)(68736007)(66066001)(105586002)(102836004); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB3936; H:TYAPR01MB3328.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: +vcRuQyw0NgAkp9uFBHlLjFE9n8y6ov2Cfty5Nh3dlns9J3uohEQZL2Akhrp15uuzMI9HvZj+Ah2jtiE1PiQmr1hSfZOsXzAej2tgrYPGgCjTMx3l5V52E26e2RJ0553j8qodJld89BfL6J6QYB3OoFhG2tTMuI1PpPjd7iq6H5kTt1K95l0i1ZtNu1xUn+WHUmG2KZX9VkG0LCGlrCUt8I4j92qFhKH4ehxXzlP2/AceRGlcX/dbGE92ml87nRgb5abCm2+xdeVgpi3UoMqQVnrL/S0BCOXk6iQQZCP/bsmqDo67OvsLPF6i/h3LnkgJzChYEP4pcBDDfssRDyJLMNFUrVX0HrXGnPcEPEJzSY= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <52ED6C9C63D07B439D52A11D7FE1470B@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13a6208d-0a36-4ece-d77f-08d64f568fc0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 02:10:51.9107 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB3936 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() 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 From: Kuninori Morimoto Current simple-card-utils has asoc_simple_card_parse_convert() to parse convert channel/rate for be_hw_params_fixup. But, it is parsing from top of node. If sound card had multi subnode, we need to parse it from each sub node. This patch tidyup asoc_simple_card_parse_convert() to allow parsing settings from each node. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 3 ++- sound/soc/generic/audio-graph-scu-card.c | 2 +- sound/soc/generic/simple-card-utils.c | 5 +++-- sound/soc/generic/simple-scu-card.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index fb0318f..d1f1717 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -116,7 +116,8 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card); void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data, struct snd_pcm_hw_params *params); -void asoc_simple_card_parse_convert(struct device *dev, char *prefix, +void asoc_simple_card_parse_convert(struct device *dev, + struct device_node *np, char *prefix, struct asoc_simple_card_data *data); int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c index 2ba35bd..1f75493 100644 --- a/sound/soc/generic/audio-graph-scu-card.c +++ b/sound/soc/generic/audio-graph-scu-card.c @@ -204,7 +204,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) if (ret < 0) return ret; - asoc_simple_card_parse_convert(dev, NULL, &priv->adata); + asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata); /* * it supports multi CPU, single CODEC only here diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 2fe7ea2..f588c93 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -32,10 +32,11 @@ void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data, } EXPORT_SYMBOL_GPL(asoc_simple_card_convert_fixup); -void asoc_simple_card_parse_convert(struct device *dev, char *prefix, +void asoc_simple_card_parse_convert(struct device *dev, + struct device_node *np, + char *prefix, struct asoc_simple_card_data *data) { - struct device_node *np = dev->of_node; char prop[128]; if (!prefix) diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index 85b46f0..2d3ef6e 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -202,7 +202,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) if (ret < 0) return ret; - asoc_simple_card_parse_convert(dev, PREFIX, &priv->adata); + asoc_simple_card_parse_convert(dev, node, PREFIX, &priv->adata); /* find 1st codec */ np = of_get_child_by_name(node, PREFIX "codec"); From patchwork Wed Nov 21 02:11:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 10691551 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 B7D5913AD for ; Wed, 21 Nov 2018 02:11:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F68A2B1EA for ; Wed, 21 Nov 2018 02:11:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93B652B1EE; Wed, 21 Nov 2018 02:11:22 +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 DAAE62B1EA for ; Wed, 21 Nov 2018 02:11:21 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B0F21267A75; Wed, 21 Nov 2018 03:11:20 +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 B1F8F267A7E; Wed, 21 Nov 2018 03:11:18 +0100 (CET) Received: from JPN01-TY1-obe.outbound.protection.outlook.com (mail-eopbgr1400117.outbound.protection.outlook.com [40.107.140.117]) by alsa0.perex.cz (Postfix) with ESMTP id A07AB267A75 for ; Wed, 21 Nov 2018 03:11:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VoRg4oQcD/eyEPRE7phw9o2euA4g01VyTYMp1oV/HQw=; b=ODeZFgPLec6UT83I8/JXFH1pXXTgLqqJt4IVqgAR0Kh3AaJzzza9NVr14rR0jyruOaO5cF7fh0Jt1t6Ee/7TZvG+KRqVGgl0ACqn/fFtu09bCiAKkmxfkEHT1lH+okvFEsTbOtyZlliv1vnNykZGurWxwpamdX9+DxD46gIzDLw= Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com (20.178.136.81) by TYAPR01MB3936.jpnprd01.prod.outlook.com (20.178.139.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.24; Wed, 21 Nov 2018 02:11:13 +0000 Received: from TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67]) by TYAPR01MB3328.jpnprd01.prod.outlook.com ([fe80::19d4:7f22:a842:9f67%4]) with mapi id 15.20.1339.027; Wed, 21 Nov 2018 02:11:13 +0000 From: Kuninori Morimoto To: Mark Brown Thread-Topic: [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() Thread-Index: AQHUgT96eHJIW+eIQUeoIm5JKyCERg== Date: Wed, 21 Nov 2018 02:11:13 +0000 Message-ID: <87r2ffp4rs.wl-kuninori.morimoto.gx@renesas.com> References: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87wop7p4wk.wl-kuninori.morimoto.gx@renesas.com> Accept-Language: ja-JP, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0110.jpnprd01.prod.outlook.com (2603:1096:404:2a::26) To TYAPR01MB3328.jpnprd01.prod.outlook.com (2603:1096:404:bb::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [211.11.155.130] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TYAPR01MB3936; 20:7qGH06Y3b4YG2QVn1GirgTTMIBGKoiJklnkNnH2xNDLNpRf2qu0Rvl3y1JXCgj3QBbeb9Tu169NnjCeJGhRLFd/V7qq6lnGVFvMBkmRWoqcW2BF+kd7xIXEW6S5H73EZvoHOBpQaXOwr9vxIl3EvXuTv1O1YJiiukasLat5dzcI= x-ms-office365-filtering-correlation-id: 6afc7c2d-1033-4246-2e21-08d64f569c8c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:TYAPR01MB3936; x-ms-traffictypediagnostic: TYAPR01MB3936: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231442)(944501410)(52105112)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:TYAPR01MB3936; BCL:0; PCL:0; RULEID:; SRVR:TYAPR01MB3936; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(136003)(376002)(346002)(396003)(189003)(199004)(5660300001)(25786009)(2906002)(6116002)(6512007)(3846002)(7736002)(386003)(53936002)(6506007)(305945005)(81166006)(8936002)(8676002)(81156014)(4326008)(14454004)(97736004)(36756003)(2900100001)(71200400001)(478600001)(71190400001)(316002)(256004)(486006)(11346002)(446003)(6916009)(99286004)(52116002)(76176011)(106356001)(86362001)(6436002)(26005)(186003)(2616005)(476003)(6486002)(68736007)(66066001)(105586002)(102836004); DIR:OUT; SFP:1102; SCL:1; SRVR:TYAPR01MB3936; H:TYAPR01MB3328.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: renesas.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: R9d4zqN78guvfVYcLLdqEU7NBGmPO63VqHAt8BvvQAC0dYyJinbnsThd8JxX6zupQKPcr5KjBVCL8WzGz0KaeIRdM9ZmlgGA6kf5mQ8H5LTZ+ie4R/53x1hMPUZmR2J+VaQtk2iER/WSC1B9OUyegKCw9OebE8V/3wsRBHxpNC1GGHUyp13oFG63pQIiw6bq1YQcG6DCQwMSZGMwXNIdjeXfH1gsSWVqc55sYxnUso3VYd/k4syTV7EFz7o3xZqmDfuJYlETgAPRFd0BBmwYYvDJKWo/DjjT3Rz9rQDZuf4VQNkhBogPAxadbm/AuKGI5n1GhuFe3xouP4iKq6Q80nGan+dimJ6ZqgMAeayoOKQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <53B2C8F69279E047A51822556C4D96A9@jpnprd01.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6afc7c2d-1033-4246-2e21-08d64f569c8c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 02:11:13.5230 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB3936 Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() 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 From: Kuninori Morimoto asoc_simple_card_of_parse_routing() had "option" parameter to consider error handling, but it is very pointless parameter. Let's remove it. Signed-off-by: Kuninori Morimoto --- include/sound/simple_card_utils.h | 3 +-- sound/soc/generic/audio-graph-card.c | 2 +- sound/soc/generic/audio-graph-scu-card.c | 2 +- sound/soc/generic/simple-card-utils.c | 10 +++------- sound/soc/generic/simple-card.c | 2 +- sound/soc/generic/simple-scu-card.c | 2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index d1f1717..6d69ed2 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -121,8 +121,7 @@ void asoc_simple_card_parse_convert(struct device *dev, struct asoc_simple_card_data *data); int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, - char *prefix, - int optional); + char *prefix); int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card, char *prefix); diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 26eb6ff..101c7da 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -238,7 +238,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) if (ret < 0) return ret; - ret = asoc_simple_card_of_parse_routing(card, NULL, 1); + ret = asoc_simple_card_of_parse_routing(card, NULL); if (ret < 0) return ret; diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c index 1f75493..c469473 100644 --- a/sound/soc/generic/audio-graph-scu-card.c +++ b/sound/soc/generic/audio-graph-scu-card.c @@ -200,7 +200,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv) * see simple-card */ - ret = asoc_simple_card_of_parse_routing(card, NULL, 0); + ret = asoc_simple_card_of_parse_routing(card, NULL); if (ret < 0) return ret; diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index f588c93..119f831 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -420,8 +420,7 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card) EXPORT_SYMBOL_GPL(asoc_simple_card_clean_reference); int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, - char *prefix, - int optional) + char *prefix) { struct device_node *node = card->dev->of_node; char prop[128]; @@ -431,11 +430,8 @@ int asoc_simple_card_of_parse_routing(struct snd_soc_card *card, snprintf(prop, sizeof(prop), "%s%s", prefix, "routing"); - if (!of_property_read_bool(node, prop)) { - if (optional) - return 0; - return -EINVAL; - } + if (!of_property_read_bool(node, prop)) + return 0; return snd_soc_of_parse_audio_routing(card, prop); } diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 5a3f59a..ff3f9fa 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -300,7 +300,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) if (ret < 0) goto card_parse_end; - ret = asoc_simple_card_of_parse_routing(card, PREFIX, 1); + ret = asoc_simple_card_of_parse_routing(card, PREFIX); if (ret < 0) goto card_parse_end; diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index 2d3ef6e..e650143 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -198,7 +198,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) if (ret < 0) return ret; - ret = asoc_simple_card_of_parse_routing(card, PREFIX, 0); + ret = asoc_simple_card_of_parse_routing(card, PREFIX); if (ret < 0) return ret;