Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2537644rwd; Mon, 15 May 2023 13:08:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Y/DEBPpPM0ylZIMSghEYzqhyEOjnvOmiSeTPUA1pRxEG3wtsMw/lw3YqvMfbt9FH0ORm6 X-Received: by 2002:a05:6a20:8f22:b0:101:962b:8dc5 with SMTP id b34-20020a056a208f2200b00101962b8dc5mr27968803pzk.36.1684181287774; Mon, 15 May 2023 13:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684181287; cv=none; d=google.com; s=arc-20160816; b=rruQ3oh0pbE2VXhgXYjMhj+5bFsS1FgiWTzLek/dsK3+MkFG1fHppJwQ/tAACRxBDk 8TZyuJJzgvtHZkj87K0c9yczCBNcwtIfPjPU2BISy66yNdHtsWFzoeo2culrrPsF49C3 pFcY3SoVmBbMzUQ8Wl9s3mHtqDDDqdD9UHaSIAq3ns7ok8zvjIZeee/swUJrRynCLjcq ucf1uSiid9DI/93lYagfEByxq4Rh79DY8heiCbdQUiLRXIoGnUd7paMgdtaIt4kLmnPk Twvrq8N5cUHZF2K0pRt2R14P4r/lGXZdODg2upzLDGMemUxpv+Q8QNYfPMXUUzfNvEyv sEqQ== 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=ZMmu+Jtm+xCqgH0l6TlKmPYujrA59t9EtYDFwsokG04=; b=L/TsQA5VV19VVFMe9MOwlUGfmeEFTS2ULDafjKPcYzOqSlJz8vl6urWWIp0JtMxloH zg5GMY//LAE5DHPbyoWc2eBDXjCHzgu2W4pV1beE0fveKAkb1mtQqSeO+Uh8EVoqcdng E/Gzyy5fkZLGqg0wLIUAh2TfjAeZ4q10HrwuJ1URrnV7iM3EKNIfEFD8acFZ1Q6oxBJu 5Xa+dpLsVQIGKW/npKZHeHfwfck5I8njGjmRIAP8M8cqctfMAK0GLBC1e2EZgzry+a71 kN3rhDv17Z3r/dUL5KrGWmuCED9Shn2wX3gYalnI4qGEZphDw5dw4Urz0ufgofqSpTXK L7QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="rr5h/hQX"; 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 j13-20020a63cf0d000000b005133f65dc69si16857673pgg.219.2023.05.15.13.07.47; Mon, 15 May 2023 13:08:07 -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="rr5h/hQX"; 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 S243631AbjEOT7f (ORCPT + 99 others); Mon, 15 May 2023 15:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243501AbjEOT7e (ORCPT ); Mon, 15 May 2023 15:59:34 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1085658D for ; Mon, 15 May 2023 12:59:31 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34FJxO41053692; Mon, 15 May 2023 14:59:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684180764; bh=ZMmu+Jtm+xCqgH0l6TlKmPYujrA59t9EtYDFwsokG04=; h=From:To:CC:Subject:Date; b=rr5h/hQX+ekYn7BB4x4Osx2Ojjg0N5sq7Mvj3ZI7Xkm2bQ0YhjJ058Z1uxRi9MFxt OlOv0m+562OQNvLuCClXxrtu+AcuyDSxU1Dgw+O+64hqgxSiHgSGPYSew1FZ2O5oif HUTuv1PC9Ub9mpc7o/1rKi3V16+wqlCf+HDsLM8s= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34FJxO4S065727 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 May 2023 14:59:24 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE114.ent.ti.com (157.170.170.25) 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 14:59:23 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE105.ent.ti.com (157.170.170.35) 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 14:59:23 -0500 Received: from fllv0039.itg.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34FJxNP9016442; Mon, 15 May 2023 14:59:23 -0500 From: Andrew Davis To: Vinod Koul , Kishon Vijay Abraham I , Siddharth Vadapalli , Roger Quadros CC: , , Andrew Davis Subject: [PATCH] phy: ti: gmii-sel: Allow parent to not be syscon node Date: Mon, 15 May 2023 14:59:22 -0500 Message-ID: <20230515195922.617243-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 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 --- 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 (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); -- 2.39.2