Message ID | 20230713200957.134480-1-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2070574vqm; Thu, 13 Jul 2023 13:31:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlF0bHbVaNTlqnuh4+k/YLNnny1lSZr0g+kxvTz8t5UtxqZZTYrcjIhKS8hIyDf7+StElfYy X-Received: by 2002:a17:902:c40c:b0:1b9:f7dc:b4f6 with SMTP id k12-20020a170902c40c00b001b9f7dcb4f6mr2482165plk.44.1689280271937; Thu, 13 Jul 2023 13:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689280271; cv=none; d=google.com; s=arc-20160816; b=gK+AOo0/D+hpDZQKXAR4IS6McbXhznB7UKLUGMelv2UgCZAVqXepbezchJh0xnX7ZJ SESXrPb+SoNKP712/8uuadhrb06zcK0v4ccnArd50O9O7euSH7QWVUeQC68fxY139dCR V/nZPCBfkTcD+Trm0MiNUjRdW0AmN8HybOj26IXHM4qA0AkX5Jk5pCOg4p+fBWFGtSYT dfUIJfcdlLxb9ibqLOOIcvoNuxR+28Njkgir0m4FEtxKdaTzlwHqPE/q9Tlhr8AEOJpO evrHB0vfmtH2uCN1kHAsH6GajXrcBFz/iqA6Ea3nRvhSCVsWBMVHaquncPbEFkZ9ELNQ wuVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mIwOozXXFg3KmTwudLxq5mLOys7noNt7A73QFukctPs=; fh=NAHayTHx8C8yQ7GKllSx0+jvXMB89xT+C3RQ5ykOftk=; b=DpXbNXEYzsGrD4vNh6cOuvgFROSb2Rg0MPV613yPZ4smtkO1PLFazjralyHARVbOR2 xmqDc+fBZjUGwilXZ7uuqHatojDAIUqkIRttT+byvTQzBDRpJU2C+S1/O1tEezZ+2LmM rDQSULUxp6qfMlu4jAcdYlKPRO41VLcG2Slf5VG+6uvrHuqNgrNLLIxHuBqVXcJjP4GX DqhUf8JI9j4ffSSrKfAnFNADPREKiVv6V3ER8QUlu5bc0Pu5te/28PBO280qCqgKyrht tU3V3VqjKU5n7a17sdJFS7xvWiHQv/Hei6DmJzCFxJII9YHjFblOejG2h1U1B+TjOEi2 qwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CcW11lxd; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7-20020a170902714700b001badbeac8d0si3296241plm.423.2023.07.13.13.30.57; Thu, 13 Jul 2023 13:31:11 -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=CcW11lxd; 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 S232469AbjGMUKW (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 13 Jul 2023 16:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjGMUKU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 13 Jul 2023 16:10:20 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20A442709 for <linux-kernel@vger.kernel.org>; Thu, 13 Jul 2023 13:10:18 -0700 (PDT) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 36DKA4sN038606; Thu, 13 Jul 2023 15:10:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1689279004; bh=mIwOozXXFg3KmTwudLxq5mLOys7noNt7A73QFukctPs=; h=From:To:CC:Subject:Date; b=CcW11lxdxpHw+7TBQif7FPJWeZE6Lc5pWYwdgj1k2jigz1JTaCYpnzMDizIAssUeN 940bCK4qSdHDiQ2HjmBBTsRVGTGyATInwTPU3M2fcHdp/fEclCnGVtnDsleJpPomzc vv+4vLLyAwMqPGkgYXdJLLyfrej/t9Ws2LlK2YQU= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 36DKA4VX068397 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 13 Jul 2023 15:10:04 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 13 Jul 2023 15:10:04 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE106.ent.ti.com (10.64.6.27) 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; Thu, 13 Jul 2023 15:10:03 -0500 Received: from fllv0040.itg.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 36DKA3Ou022042; Thu, 13 Jul 2023 15:10:03 -0500 From: Andrew Davis <afd@ti.com> To: Vinod Koul <vkoul@kernel.org>, Kishon Vijay Abraham I <kishon@kernel.org>, Siddharth Vadapalli <s-vadapalli@ti.com>, Roger Quadros <rogerq@kernel.org> CC: <linux-phy@lists.infradead.org>, <linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com> Subject: [PATCH v2] phy: ti: gmii-sel: Allow parent to not be syscon node Date: Thu, 13 Jul 2023 15:09:57 -0500 Message-ID: <20230713200957.134480-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771338750660901317 X-GMAIL-MSGID: 1771338750660901317 |
Series |
[v2] phy: ti: gmii-sel: Allow parent to not be syscon node
|
|
Commit Message
Andrew Davis
July 13, 2023, 8:09 p.m. UTC
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.
Signed-off-by: Andrew Davis <afd@ti.com>
---
Changes from v1:
- Rebased on v6.5-rc1
drivers/phy/ti/phy-gmii-sel.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
Comments
On 14/07/23 01:39, 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. > > Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com> > --- > > Changes from v1: > - Rebased on v6.5-rc1 > > 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 6286cf25a4264..555b323f45da1 100644 > --- a/drivers/phy/ti/phy-gmii-sel.c > +++ b/drivers/phy/ti/phy-gmii-sel.c > @@ -465,9 +465,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 (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);
On 13/07/2023 23:09, 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. > > Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Roger Quadros <rogerq@ti.com>
On Thu, 13 Jul 2023 15:09:57 -0500, 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. > > Applied, thanks! [1/1] phy: ti: gmii-sel: Allow parent to not be syscon node commit: 1fdfa7cccd35519d97a1f301b8143ea4196b2d16 Best regards,
diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index 6286cf25a4264..555b323f45da1 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -465,9 +465,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 (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);