From patchwork Wed Oct 4 12:28:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 9984513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0D6560237 for ; Wed, 4 Oct 2017 12:28:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E540B2876A for ; Wed, 4 Oct 2017 12:28:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9FA428AE7; Wed, 4 Oct 2017 12:28: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=-1.9 required=2.0 tests=BAYES_00, 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 651822876A for ; Wed, 4 Oct 2017 12:28:56 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 42E8B26736B; Wed, 4 Oct 2017 14:28:52 +0200 (CEST) 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 C83B32673E2; Wed, 4 Oct 2017 14:28:50 +0200 (CEST) Received: from michel.telenet-ops.be (michel.telenet-ops.be [195.130.137.88]) by alsa0.perex.cz (Postfix) with ESMTP id 0B6D4266DBB for ; Wed, 4 Oct 2017 14:28:48 +0200 (CEST) Received: from ayla.of.borg ([84.195.106.246]) by michel.telenet-ops.be with bizsmtp id HQUn1w0155JzmfG06QUniN; Wed, 04 Oct 2017 14:28:48 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1dzin9-0000tQ-OO; Wed, 04 Oct 2017 14:28:47 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1dzimu-0003Tm-Aj; Wed, 04 Oct 2017 14:28:32 +0200 From: Geert Uytterhoeven To: Liam Girdwood , Mark Brown , Kuninori Morimoto Date: Wed, 4 Oct 2017 14:28:30 +0200 Message-Id: <1507120110-13336-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 Cc: linux-renesas-soc@vger.kernel.org, alsa-devel@alsa-project.org, Takashi Iwai , Geert Uytterhoeven Subject: [alsa-devel] [PATCH] ASoC: fsi: Use of_device_get_match_data() helper 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 Use the of_device_get_match_data() helper instead of open coding. Note that when used with DT, there's always a valid match. Signed-off-by: Geert Uytterhoeven --- sound/soc/sh/fsi.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 6d3c7706d93fbc10..c3aaf4788557c4e1 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1932,14 +1932,9 @@ static int fsi_probe(struct platform_device *pdev) core = NULL; if (np) { - const struct of_device_id *of_id; - - of_id = of_match_device(fsi_of_match, &pdev->dev); - if (of_id) { - core = of_id->data; - fsi_of_parse("fsia", np, &info.port_a, &pdev->dev); - fsi_of_parse("fsib", np, &info.port_b, &pdev->dev); - } + core = of_device_get_match_data(&pdev->dev); + fsi_of_parse("fsia", np, &info.port_a, &pdev->dev); + fsi_of_parse("fsib", np, &info.port_b, &pdev->dev); } else { const struct platform_device_id *id_entry = pdev->id_entry; if (id_entry)