From mboxrd@z Thu Jan 1 00:00:00 1970 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 EC6ECC433EF for ; Mon, 21 Mar 2022 04:00:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5352F166A; Mon, 21 Mar 2022 04:59:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5352F166A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1647835222; bh=Y4RPiSr+4ZFbLITcBxYisXPJwqdGgqpzoccbeNlhlz8=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ozGWGiYyuf5COe2PvW5IIJh+XrbxWuIQ8lzkdcfOwmWVViLFI/DXhaWryj9t016LB GT+RH9XIq5q9Z4VfEdr6RSGZ68wx/jT/jf2DB97ubQDKe8mhYzMbaLeTB5fvHWdvpO pH7GMWab64AXE1kyOX1F6iBmGgTWDSWepPQHAtfc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D9110F801D8; Mon, 21 Mar 2022 04:59:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 88AE6F80227; Mon, 21 Mar 2022 04:59:29 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5B113F80116 for ; Mon, 21 Mar 2022 04:59:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B113F80116 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hbwrRg3d" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B40560B4D; Mon, 21 Mar 2022 03:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0256C340EE; Mon, 21 Mar 2022 03:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647835162; bh=Y4RPiSr+4ZFbLITcBxYisXPJwqdGgqpzoccbeNlhlz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hbwrRg3dYYgVo5Vm2TvAvXfrFT8frw0Wgc6mDOmq/9KM9ZfGyxLu1VI5czKGhU6JO 2+Y2MGwgodRQ30iyM+I4c+s/g5MnUGA6MHN8PLuL6q3voUYcZ8o6UIkSglFBBn1Tnh faphTUcxF9tZ3m2pXj3IIFyt81s07xTtLwQgUGuMpaHDvdUmvvS8OmXes7vyaV/if6 fK4noFy9Xqf7p/3jA5XXnP4c02IcfYODnzIHDP6V/G6qwxRKp1QUlFPrcby8NuTUXW Z5GTM+y05VGUrlxfNDooAnuf1v3Ui7TuoUszGLiIU298vFP69UBE/H5jSW+BoIbW1N 6xM9z2M47Z8CQ== Date: Mon, 21 Mar 2022 11:59:17 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Subject: Re: [v5 2/4] ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speaker Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-3-jiaxin.yu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220319114111.11496-3-jiaxin.yu@mediatek.com> Cc: devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, robh+dt@kernel.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, broonie@kernel.org, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" On Sat, Mar 19, 2022 at 07:41:09PM +0800, Jiaxin Yu wrote: > static int mt8192_mt6359_dev_probe(struct platform_device *pdev) [...] > + hdmi_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,hdmi-codec", 0); > + if (!hdmi_codec) { > ret = -EINVAL; > - goto put_platform_node; > + dev_err_probe(&pdev->dev, ret, "Property 'hdmi-codec' missing or invalid\n"); > + goto err_hdmi_codec; > } > - card->dev = &pdev->dev; > > - hdmi_codec = of_parse_phandle(pdev->dev.of_node, > - "mediatek,hdmi-codec", 0); > + speaker_codec = of_get_child_by_name(pdev->dev.of_node, "mediatek,speaker-codec"); > + if (!speaker_codec) { > + ret = -EINVAL; > + dev_err_probe(&pdev->dev, ret, "Property 'speaker_codec' missing or invalid\n"); > + goto err_speaker_codec; > + } (to be neat) Does it have any reason to prevent from using of_parse_phandle() but of_get_child_by_name()? From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3269BC433F5 for ; Mon, 21 Mar 2022 03:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iMecl2xVbH3rYgPLC1js67hdB8OAbnOWJS6YkKd3n5w=; b=baCJNhXrajFCh/ ZTGdZrHbdGcO//quIZ+G5OTOJ40+3/TuvpXKWlolKIvT3GEU6ANHfPkWTDTqIh3VW4Yd/QCnNv/7+ GC961x0Iu93OpqNNO3RgbE60P1C/D5Uvo4IXlOpX1w6NDgcshUYuZFzhtM5nDdsIn9+eUSrhDSeZI i6yj8NPeDX3v/j8ZHyUbd2xCBY/GLcTWLrHvpkU9xIbOf+bLwDohjyWFo6pcdncuj+SjFtLeK1raV UNPsOnJpwjSkA4GcLZ5OZSgFCngU96wvN5/tLkak3dIKzRCoOh2VjYqHXnfmVK7N2JWWxoOO66jCh NGTFeHs+qaEo+6lOOBtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW9Cj-006Q3q-V8; Mon, 21 Mar 2022 03:59:37 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW9CY-006Q1u-Lx; Mon, 21 Mar 2022 03:59:27 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B40560B4D; Mon, 21 Mar 2022 03:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0256C340EE; Mon, 21 Mar 2022 03:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647835162; bh=Y4RPiSr+4ZFbLITcBxYisXPJwqdGgqpzoccbeNlhlz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hbwrRg3dYYgVo5Vm2TvAvXfrFT8frw0Wgc6mDOmq/9KM9ZfGyxLu1VI5czKGhU6JO 2+Y2MGwgodRQ30iyM+I4c+s/g5MnUGA6MHN8PLuL6q3voUYcZ8o6UIkSglFBBn1Tnh faphTUcxF9tZ3m2pXj3IIFyt81s07xTtLwQgUGuMpaHDvdUmvvS8OmXes7vyaV/if6 fK4noFy9Xqf7p/3jA5XXnP4c02IcfYODnzIHDP6V/G6qwxRKp1QUlFPrcby8NuTUXW Z5GTM+y05VGUrlxfNDooAnuf1v3Ui7TuoUszGLiIU298vFP69UBE/H5jSW+BoIbW1N 6xM9z2M47Z8CQ== Date: Mon, 21 Mar 2022 11:59:17 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 2/4] ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speaker Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-3-jiaxin.yu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220319114111.11496-3-jiaxin.yu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220320_205926_790709_3A7184DB X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Sat, Mar 19, 2022 at 07:41:09PM +0800, Jiaxin Yu wrote: > static int mt8192_mt6359_dev_probe(struct platform_device *pdev) [...] > + hdmi_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,hdmi-codec", 0); > + if (!hdmi_codec) { > ret = -EINVAL; > - goto put_platform_node; > + dev_err_probe(&pdev->dev, ret, "Property 'hdmi-codec' missing or invalid\n"); > + goto err_hdmi_codec; > } > - card->dev = &pdev->dev; > > - hdmi_codec = of_parse_phandle(pdev->dev.of_node, > - "mediatek,hdmi-codec", 0); > + speaker_codec = of_get_child_by_name(pdev->dev.of_node, "mediatek,speaker-codec"); > + if (!speaker_codec) { > + ret = -EINVAL; > + dev_err_probe(&pdev->dev, ret, "Property 'speaker_codec' missing or invalid\n"); > + goto err_speaker_codec; > + } (to be neat) Does it have any reason to prevent from using of_parse_phandle() but of_get_child_by_name()? _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8C944C433EF for ; Mon, 21 Mar 2022 04:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+F2l59/ElhV3BhF6NciqCCc90Zjx93LVkmgbaqzC9yg=; b=vkTI+q6SdsNjeF HV141vWISd8Q5u1gaD9OcxdllgME4FkTgx/v/nyP0V6SsGx+0+lShcPWbQ7z9nVNWNe1DvMz3cDNS azakftvyGlRWrCowJZm27qMzFw26vUPFTsXLFVXf45W0ZI+O9tETuLPDhFZwtoX384uB728BkEOep NaNGnLP0+g2bb0ECMVZIxgQH4Ry1DXeew9tXUXN3p1CCGaJKdsxookVZbU9Bjo/hFQK+QCqWY7HTq 9bjZJoBqL7gH0cWo2NzClKzaKQ4iJRAT86yLhpvWpUgpsRl4nC1WJ1P1HmpagEbqKgj0Ak4p8W6e2 b5kThwtNno0HaNpNfOTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW9Cb-006Q3A-Tp; Mon, 21 Mar 2022 03:59:30 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nW9CY-006Q1u-Lx; Mon, 21 Mar 2022 03:59:27 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B40560B4D; Mon, 21 Mar 2022 03:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0256C340EE; Mon, 21 Mar 2022 03:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647835162; bh=Y4RPiSr+4ZFbLITcBxYisXPJwqdGgqpzoccbeNlhlz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hbwrRg3dYYgVo5Vm2TvAvXfrFT8frw0Wgc6mDOmq/9KM9ZfGyxLu1VI5czKGhU6JO 2+Y2MGwgodRQ30iyM+I4c+s/g5MnUGA6MHN8PLuL6q3voUYcZ8o6UIkSglFBBn1Tnh faphTUcxF9tZ3m2pXj3IIFyt81s07xTtLwQgUGuMpaHDvdUmvvS8OmXes7vyaV/if6 fK4noFy9Xqf7p/3jA5XXnP4c02IcfYODnzIHDP6V/G6qwxRKp1QUlFPrcby8NuTUXW Z5GTM+y05VGUrlxfNDooAnuf1v3Ui7TuoUszGLiIU298vFP69UBE/H5jSW+BoIbW1N 6xM9z2M47Z8CQ== Date: Mon, 21 Mar 2022 11:59:17 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 2/4] ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speaker Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-3-jiaxin.yu@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220319114111.11496-3-jiaxin.yu@mediatek.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220320_205926_790709_3A7184DB X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Mar 19, 2022 at 07:41:09PM +0800, Jiaxin Yu wrote: > static int mt8192_mt6359_dev_probe(struct platform_device *pdev) [...] > + hdmi_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,hdmi-codec", 0); > + if (!hdmi_codec) { > ret = -EINVAL; > - goto put_platform_node; > + dev_err_probe(&pdev->dev, ret, "Property 'hdmi-codec' missing or invalid\n"); > + goto err_hdmi_codec; > } > - card->dev = &pdev->dev; > > - hdmi_codec = of_parse_phandle(pdev->dev.of_node, > - "mediatek,hdmi-codec", 0); > + speaker_codec = of_get_child_by_name(pdev->dev.of_node, "mediatek,speaker-codec"); > + if (!speaker_codec) { > + ret = -EINVAL; > + dev_err_probe(&pdev->dev, ret, "Property 'speaker_codec' missing or invalid\n"); > + goto err_speaker_codec; > + } (to be neat) Does it have any reason to prevent from using of_parse_phandle() but of_get_child_by_name()? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7486C433EF for ; Mon, 21 Mar 2022 03:59:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229639AbiCUEAr (ORCPT ); Mon, 21 Mar 2022 00:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiCUEAr (ORCPT ); Mon, 21 Mar 2022 00:00:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C61AE5E; Sun, 20 Mar 2022 20:59:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A9C5860C6E; Mon, 21 Mar 2022 03:59:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0256C340EE; Mon, 21 Mar 2022 03:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647835162; bh=Y4RPiSr+4ZFbLITcBxYisXPJwqdGgqpzoccbeNlhlz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hbwrRg3dYYgVo5Vm2TvAvXfrFT8frw0Wgc6mDOmq/9KM9ZfGyxLu1VI5czKGhU6JO 2+Y2MGwgodRQ30iyM+I4c+s/g5MnUGA6MHN8PLuL6q3voUYcZ8o6UIkSglFBBn1Tnh faphTUcxF9tZ3m2pXj3IIFyt81s07xTtLwQgUGuMpaHDvdUmvvS8OmXes7vyaV/if6 fK4noFy9Xqf7p/3jA5XXnP4c02IcfYODnzIHDP6V/G6qwxRKp1QUlFPrcby8NuTUXW Z5GTM+y05VGUrlxfNDooAnuf1v3Ui7TuoUszGLiIU298vFP69UBE/H5jSW+BoIbW1N 6xM9z2M47Z8CQ== Date: Mon, 21 Mar 2022 11:59:17 +0800 From: Tzung-Bi Shih To: Jiaxin Yu Cc: broonie@kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, linmq006@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, linux-mediatek@lists.infradead.org, trevor.wu@mediatek.com, matthias.bgg@gmail.com, aaronyu@google.com, linux-arm-kernel@lists.infradead.org, angelogioacchino.delregno@collabora.com Subject: Re: [v5 2/4] ASoC: mediatek: mt8192: refactor for I2S3 DAI link of speaker Message-ID: References: <20220319114111.11496-1-jiaxin.yu@mediatek.com> <20220319114111.11496-3-jiaxin.yu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220319114111.11496-3-jiaxin.yu@mediatek.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Sat, Mar 19, 2022 at 07:41:09PM +0800, Jiaxin Yu wrote: > static int mt8192_mt6359_dev_probe(struct platform_device *pdev) [...] > + hdmi_codec = of_parse_phandle(pdev->dev.of_node, "mediatek,hdmi-codec", 0); > + if (!hdmi_codec) { > ret = -EINVAL; > - goto put_platform_node; > + dev_err_probe(&pdev->dev, ret, "Property 'hdmi-codec' missing or invalid\n"); > + goto err_hdmi_codec; > } > - card->dev = &pdev->dev; > > - hdmi_codec = of_parse_phandle(pdev->dev.of_node, > - "mediatek,hdmi-codec", 0); > + speaker_codec = of_get_child_by_name(pdev->dev.of_node, "mediatek,speaker-codec"); > + if (!speaker_codec) { > + ret = -EINVAL; > + dev_err_probe(&pdev->dev, ret, "Property 'speaker_codec' missing or invalid\n"); > + goto err_speaker_codec; > + } (to be neat) Does it have any reason to prevent from using of_parse_phandle() but of_get_child_by_name()?