Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3038296rdh; Mon, 27 Nov 2023 05:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5qmuh3SwtYdOY79EI2ItMaUeNOkH4pQ1VnIFnBlP96KiLEYv1HXMPN63y+7JgU7f9GcP3 X-Received: by 2002:a17:903:181:b0:1cf:6bdf:7642 with SMTP id z1-20020a170903018100b001cf6bdf7642mr10288128plg.18.1701091206716; Mon, 27 Nov 2023 05:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701091206; cv=none; d=google.com; s=arc-20160816; b=s8C+8OI7W/9xGcbGpmMlDsnxBlhgb1Qvae4Y0JJWUpv+Sdk7gkTggHke4BnxdejB17 OktCVWaKNC2cxAw/3Zm9D7mUj7Xvs54csF66ksaI9jCW2G5/478yBs/IXre2QsiwZPnJ bNB21ZibRDKGHT/gMASlxxnL1cGpnR9FAcN4azGMVwGNVwCxiCaTwJ86IV7kl+Dy7SSJ kQ9DGOCvwbjAtz+hIF6t1M010KDW7Ss/4QKoC+4D+qJ3MXE/NWTTuAT/h+mlcySMBL1t 9kqtaJi4C83HfnMPTWA0aYVJ7mVafaoLDKb27OJ5Kfp//VYyOr0uljL0BoP7zHtWulmv 8bjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=HsglRStD8CJKrh0jxjm9u0u3oJ7kHkH+vLhcAfrAuUM=; fh=7I906OfhklpbDlN/7/KiEHecS+n3+tbMhB94WkSPlME=; b=Dq/3CRnMqvre0djmVFaBkmtjUdqftnUxAXes+Rx/Sr+e2vf0r+FLi8cgCoQaRNwDZJ fnLOidtPTlML/1tfP8ctM7b9SeTUnB9oiSjaH4Z92QSqmNltkoxhcxy9pNXsUmFSXsgI pGWgAQJG+bYuv8QWZDCZbL8VsRm3T3cvQK0rNHTVRFUwc9Nw+2x7H/PDvsjqVBcRNRef OE5ykzq73dV0WyZxC9RJzSGl8u9Ccy9i9VZdLncglUgFpUL4yh3n4DE/OaU95WhFXOal 8uDH5PZlQPknQ/koPFOkHNrguy7Xn8E69AWopWts1yLJDfFeM1Bdfqm6DcgWOLWGmsBu 57+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id n10-20020a1709026a8a00b001c746bca05dsi8923410plk.69.2023.11.27.05.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 05:20:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 16C9380A1E3E; Mon, 27 Nov 2023 05:20:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233434AbjK0NTs convert rfc822-to-8bit (ORCPT + 99 others); Mon, 27 Nov 2023 08:19:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbjK0NTr (ORCPT ); Mon, 27 Nov 2023 08:19:47 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6CDB8 for ; Mon, 27 Nov 2023 05:19:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r7bUD-0007pG-Nn; Mon, 27 Nov 2023 14:17:17 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7bUB-00BxG9-Dp; Mon, 27 Nov 2023 14:17:15 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1r7bUB-000Cxr-18; Mon, 27 Nov 2023 14:17:15 +0100 Message-ID: <939b96b8727054729207211f25ff91ccf8328e28.camel@pengutronix.de> Subject: Re: [PATCH v1 2/2] phy: starfive: Add mipi dphy tx support From: Philipp Zabel To: Shengyang Chen , devicetree@vger.kernel.org, linux-phy@lists.infradead.org Cc: vkoul@kernel.org, kishon@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, minda.chen@starfivetech.com, changhuang.liang@starfivetech.com, rogerq@kernel.org, geert+renesas@glider.be, keith.zhao@starfivetech.com, linux-kernel@vger.kernel.org Date: Mon, 27 Nov 2023 14:17:15 +0100 In-Reply-To: <20231117130421.79261-3-shengyang.chen@starfivetech.com> References: <20231117130421.79261-1-shengyang.chen@starfivetech.com> <20231117130421.79261-3-shengyang.chen@starfivetech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email 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 (howler.vger.email [0.0.0.0]); Mon, 27 Nov 2023 05:20:04 -0800 (PST) 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); > + } > + > + 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. > + } > + > + 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. > + } > + > + dphy->sys_rst = reset_control_get_exclusive(&pdev->dev, "dphy_sys"); Why not devm_reset_control_get_exclusive()? > + 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. > + 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. regards Philipp