Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2539533rdb; Sun, 3 Dec 2023 23:26:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtS1DBzbPAjiu/V/vXM8ufG4G4/fI3ky5wLkRzwiHN3eyuQnH0/b/nw/9LxCmQDMSx8K7r X-Received: by 2002:a05:6871:8903:b0:1fb:75a:7793 with SMTP id ti3-20020a056871890300b001fb075a7793mr4361633oab.68.1701674787713; Sun, 03 Dec 2023 23:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701674787; cv=none; d=google.com; s=arc-20160816; b=eqGaKGmVqrrRxUXScKUrxq+fV1i6hvCzL+NecJD2+ak9uhG7NuUgZ6R8DQKhcdUSHa VFj74kX5yOPRiJJlo87ykcTtKWTqoopBg1rZ0G/dhTIrwe+s3jfGvVYWeZEyzMM1o+BQ exqeFM2Urg4k9ZRSpDV7rsEzIz2dWNSYb0z7uYr4Ed+A92rFIOGTgTHDq88tUzFOzSDe WHG1Wa0NvvcrpNNb314/d5WSha93zwwWSkMjk9nmT4hfSqPIETEQGjKk33QJw0q3z2ng ryOyIMRWxm2KR7TgRxUWkF/18S7ndh5BkexiAhVUkFboB0+8H3ClwoZhYGF3vL4LjSN7 vUmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=NElRuOihlNUu4jzmloACWjrYe9E0kZmtfgtOlftezR4=; fh=zkuOAtjKS2WM3U0OfcK/T8URyqypMv0RUZEt0J9A7fY=; b=AG7I1jDTfFlrT60FYB8OUhyEC32o/nKqt3V/HOYxsbvW+VSbv508dAhyiRbq1QAWn6 HUu1GKndjjyDtu+Iy47r7vj0zU9qPVUwduWLUf1bQtmaRD3f0G11d7TXVvlGjr2ALzwl udiZQIZSTRGABClyxdKaVvuVqQRIk1p+HAnGofgl+HTix2p8sDRJoXzo7NxKePBqr2Mw TA9EmzMmNYLCIoTyB6hE1L78VnhxyjUqAQVV7OvQANiykK531qfwrKNKhZLORvdPVGtE Rpnjcvt1ekheccN7XKz+Ll8h075SqxvO1pQdbDMOBSaREPW+ClmiAPOXncTpVGOXjrom z34w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id r37-20020a635d25000000b005a0737404a7si7527666pgb.258.2023.12.03.23.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 23:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A1953805ECEA; Sun, 3 Dec 2023 23:26:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234623AbjLDH0L (ORCPT + 99 others); Mon, 4 Dec 2023 02:26:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234593AbjLDH0J (ORCPT ); Mon, 4 Dec 2023 02:26:09 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 393D3FF; Sun, 3 Dec 2023 23:26:14 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 595A08471; Mon, 4 Dec 2023 15:26:06 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 4 Dec 2023 15:26:06 +0800 Received: from [192.168.125.88] (183.27.97.199) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 4 Dec 2023 15:26:05 +0800 Message-ID: <26cd5320-e520-4614-9628-df1a1f47b34a@starfivetech.com> Date: Mon, 4 Dec 2023 15:22:54 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 2/2] phy: starfive: Add mipi dphy tx support Content-Language: en-US To: Philipp Zabel , , CC: , , , , , , , , , , References: <20231117130421.79261-1-shengyang.chen@starfivetech.com> <20231117130421.79261-3-shengyang.chen@starfivetech.com> <939b96b8727054729207211f25ff91ccf8328e28.camel@pengutronix.de> From: Shengyang Chen In-Reply-To: <939b96b8727054729207211f25ff91ccf8328e28.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.97.199] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 03 Dec 2023 23:26:26 -0800 (PST) Hi Philipp, Thanks for review and comment. On 2023/11/27 21:17, Philipp Zabel wrote: > On Fr, 2023-11-17 at 21:04 +0800, Shengyang Chen wrote: >> Add mipi dphy tx support for the StarFive JH7110 SoC. >> It is used to transfer DSI data. >> >> Signed-off-by: Shengyang Chen >> --- > [...] >> diff --git a/drivers/phy/starfive/phy-jh7110-dphy-tx.c b/drivers/phy/starfive/phy-jh7110-dphy-tx.c >> new file mode 100644 >> index 000000000000..69aa172563e4 >> --- /dev/null >> +++ b/drivers/phy/starfive/phy-jh7110-dphy-tx.c >> @@ -0,0 +1,542 @@ > [...] >> +static int stf_dphy_probe(struct platform_device *pdev) >> +{ > [...] >> + dphy->topsys = devm_platform_ioremap_resource(pdev, 0); >> + if (IS_ERR(dphy->topsys)) { >> + ret = PTR_ERR(dphy->topsys); >> + return ret; > > This could be shortened to: > > return PTR_ERR(dphy->topsys); > ok, will shortened to "return PTR_ERR(dphy->topsys);" >> + } >> + >> + pm_runtime_enable(&pdev->dev); >> + >> + dphy->mipitx_0p9 = devm_regulator_get(&pdev->dev, "mipi_0p9"); >> + if (IS_ERR(dphy->mipitx_0p9)) { >> + ret = PTR_ERR(dphy->mipitx_0p9); >> + return ret; > > Same as above. > ok, will fix it. >> + } >> + >> + dphy->txesc_clk = devm_clk_get(&pdev->dev, "dphy_txesc"); >> + if (IS_ERR(dphy->txesc_clk)) { >> + ret = PTR_ERR(dphy->txesc_clk); >> + dev_err(&pdev->dev, "txesc_clk get error\n"); >> + return ret; > > Consider using dev_err_probe(): > > return dev_err_probe(&pdev->dev, PTR_ERR(dphy->txesc_clk), > "txesc_clk get error\n"); > > And the same for the error paths below. > ok, it will be tried and verified. It will be used if no problem. >> + } >> + >> + dphy->sys_rst = reset_control_get_exclusive(&pdev->dev, "dphy_sys"); > > Why not devm_reset_control_get_exclusive()? > ok, it will be tried and verified. It will be used if no problem. >> + if (IS_ERR(dphy->sys_rst)) { >> + ret = PTR_ERR(dphy->sys_rst); >> + dev_err(&pdev->dev, "sys_rst get error\n"); >> + return ret; >> + } >> + >> + dphy->txbytehs_rst = reset_control_get_exclusive(&pdev->dev, "dsi_txbytehs"); > > Same as above. > ok, I'll follow up on this. >> + if (IS_ERR(dphy->txbytehs_rst)) { >> + dev_err(&pdev->dev, "Failed to get txbytehs_rst\n"); >> + return PTR_ERR(dphy->txbytehs_rst); >> + } >> + >> + dphy->phy = devm_phy_create(&pdev->dev, NULL, &stf_dphy_ops); >> + if (IS_ERR(dphy->phy)) { >> + ret = PTR_ERR(dphy->phy); >> + dev_err(&pdev->dev, "Failed to create phy\n"); >> + return ret; >> + } >> + phy_set_drvdata(dphy->phy, dphy); >> + >> + phy_provider = devm_of_phy_provider_register(&pdev->dev, of_phy_simple_xlate); >> + if (IS_ERR(phy_provider)) { >> + ret = PTR_ERR(phy_provider); >> + dev_err(&pdev->dev, "Failed to create phy\n"); >> + return ret; >> + } >> + >> + return PTR_ERR_OR_ZERO(phy_provider); > > This can not be reached in the error case, so just: > > return 0; > > should suffice. > ok, will fix it. > > regards > Philipp thanks a lot. Best Regards, Shengyang