Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp118365rwd; Mon, 15 May 2023 21:20:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gNnjN4wdy30u9OWWbP3ly/R3mq252e5dxF1mvD1o50KDNk7OtgdpU5PXY3Vv933jhzZNB X-Received: by 2002:a17:90b:354d:b0:253:2927:4a22 with SMTP id lt13-20020a17090b354d00b0025329274a22mr188292pjb.48.1684210843814; Mon, 15 May 2023 21:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684210843; cv=none; d=google.com; s=arc-20160816; b=aymTapN+PvpXTQyQUhsUilclwILXmlrqF0WCjZQoBTHU/hi162icXmk6Pqr9hrmI7y Q/6n7hiseILCtVNUO6PBxxLmFTi79n//+fCxhFpF3D4fE7trDm18I36oZiLAkPanh2mx +oB2x68Uqk4jiSrxQCytYu6IDptyAQxJYN0TaNEkShw+jtyrvI0ubDXj8GaInvKvdT/i il1NClVBm8kqqJj4L/iRQnmIMOuXbUtZR41i4i6dGLB9rFxAb7PXDaPU8ifJ6Y8T/w13 oCqTt3MXJbVNhtiQBzztZgO942XFjpY1by/4hx0TinFAVnpCh3Bt809GcNlz1CQK4ksW RgYg== 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 :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=JNhUHHuThHL5ZN5KuFWCha6xK5Kp9GKuvY5H0edATkY=; b=g+/UqGPwTV1zkzMGB/Az2hSh9ICe6Zr0CM29gzynAUDb8dFieD0HXDmEiDo5S63qRh co7dOp58iNAnwXsSH5K6Ktz0L5ZqaHvbArvnzpN03ohSNgdd2Xt6XpsXJXa2uaKxkMtL fm/XhIslKRxpR2BwB9k1V/TgOAwnKnpInqHrpc/u7rfrvN9KEljjcqkiQOtlAgcAkdSB l2WeR7Iwj8ijVPh4kaj/VEVXD8elI3mqbiSyWjNtZOP2+sPxfqjS58uNpVP18jT/2I6L nBlRdYVKFDubQLgWa1O4d2f6ewp8Q20VwH3IXAqOtCvkfKUaZBuM1keLcMuZfhCSJ8rm nx6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nl+1qLee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020a17090aa89300b00232f57260c1si935348pjq.1.2023.05.15.21.20.29; Mon, 15 May 2023 21:20:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nl+1qLee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbjEPEGU (ORCPT + 99 others); Tue, 16 May 2023 00:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229809AbjEPEGN (ORCPT ); Tue, 16 May 2023 00:06:13 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62EEE55BD for ; Mon, 15 May 2023 21:06:09 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34G45xMY010672; Mon, 15 May 2023 23:05:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684209959; bh=JNhUHHuThHL5ZN5KuFWCha6xK5Kp9GKuvY5H0edATkY=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=nl+1qLeesxlDh4JAy2+ajh+BWmaYn5uOHF5GMBpARo89o3N0J73u/Dsl2WcYnk+Y7 0vRtFwqhFm4y8TqjBlRRKJe0aEQ79F8j7szqOSkaV6L9x23mGr94eHXGG68i93SDvM WKkolFXTY5GI0jQ6w9JzYn0y9ttCObI/WW9pNPhw= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34G45xPR015389 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 May 2023 23:05:59 -0500 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 15 May 2023 23:05:59 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 15 May 2023 23:05:59 -0500 Received: from [172.24.145.61] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34G45uCk048986; Mon, 15 May 2023 23:05:57 -0500 Message-ID: <5ae4bd37-65ee-d6da-1ab6-c1018d9959ec@ti.com> Date: Tue, 16 May 2023 09:35:56 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 CC: Vinod Koul , Kishon Vijay Abraham I , Roger Quadros , , , Subject: Re: [PATCH] phy: ti: gmii-sel: Allow parent to not be syscon node To: Andrew Davis References: <20230515195922.617243-1-afd@ti.com> Content-Language: en-US From: Siddharth Vadapalli In-Reply-To: <20230515195922.617243-1-afd@ti.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Andrew, On 16/05/23 01:29, Andrew Davis wrote: > If the parent node is not a syscon type, then fallback and check > if we can get a regmap from our own node. This no longer forces > us to make the parent of this node a syscon node when that might > not be appropriate. Could you please let me know in which cases it is appropriate versus in which cases it isn't? Is syscon_node_to_regmap() being retained for backward compatibility until the device-tree nodes are cleaned up across all devices? > > Signed-off-by: Andrew Davis > --- > drivers/phy/ti/phy-gmii-sel.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c > index 8c667819c39a..1e67ed9a5cf6 100644 > --- a/drivers/phy/ti/phy-gmii-sel.c > +++ b/drivers/phy/ti/phy-gmii-sel.c > @@ -435,9 +435,12 @@ static int phy_gmii_sel_probe(struct platform_device *pdev) > > priv->regmap = syscon_node_to_regmap(node->parent); > if (IS_ERR(priv->regmap)) { > - ret = PTR_ERR(priv->regmap); > - dev_err(dev, "Failed to get syscon %d\n", ret); > - return ret; > + priv->regmap = device_node_to_regmap(node); If device_node_to_regmap() can always be used with the corresponding changes made to the device-tree nodes, wouldn't it be better to use it directly instead of using it as a fallback? (This is based on the assumption that syscon_node_to_regmap() is only being retained until the device-tree nodes are cleaned up to work with device_node_to_regmap()). > + if (IS_ERR(priv->regmap)) { > + ret = PTR_ERR(priv->regmap); > + dev_err(dev, "Failed to get syscon %d\n", ret); > + return ret; > + } > } > > ret = phy_gmii_sel_init_ports(priv); -- Regards, Siddharth.