Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp73244ybh; Tue, 21 Jul 2020 16:44:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWyq9t469S+KIFP9C76Bc8R1RIyH9Dse27BranN+bsiGK4L/pYKF/6sP+rcOtbcy3wpkzK X-Received: by 2002:a17:906:e0c7:: with SMTP id gl7mr26054517ejb.264.1595375049369; Tue, 21 Jul 2020 16:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595375049; cv=none; d=google.com; s=arc-20160816; b=w3FOUxggob36xaXufUOM8ekHeDxCc/MqCuOxZoNXOb5kZZfsO/f40SZBkPpVRh7C6B scFglecR1XPANSEkUzwo2Siop/4ZYd2cGgSjYBAQ5oHZzFGiORw/fWVJsJOp1mqFLPa8 o/0hZIGse8j6qkCSI1yNayu0tw16iUH85uiekJOMGEMGqxhTNXX4vOEY5HcVYcCZiFh7 2f2MRq91HboDJN34Yy0iwEgrjTn5fwhlmNLFf2YemgdZnJYkbLVBZkaMhO0bbl3oYlui 2qzZ7/gaTZR0LLXSdO/M5j1cXPCuwkB/q0D/u15/q6TMFykWpbhmU7UuxPGa/lxEx7LL dteQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=M57k5GNdOhuFYfIUg8vfITWLthlh55K2f8tW0oPt63g=; b=bEybnkPw/GGNjPIZlaoAjmmo5oXqXcT4Qznd0UEfZR15PXgFm/j85S07P4ab9wVxNr AaD/4MhSkhtwHMqive/wZVXqfNCdPiB70z9V9We8KCoKjS7UnDcsH3Y4ukLl0nsxVsEa JurNo2ZPjrqPR7sN8eD9vvZDgNCsQOe7hcKGCa1WW85TnTvPptRZUvd6zNR+q1VbkRFC vFOY48LjVDcAhzOG+ddApvePL8qCHYTsjsScjXU4AXOvTCTGRpSKLfHLBjGzooUXWbri gBJhzxyrnsiZSk6xTlk0afoVVkwj0CuBDREEOYGKrpi+2lWjq/65AN2vdhuGixnJE055 O0pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XbsdunOd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lv11si12354225ejb.106.2020.07.21.16.43.31; Tue, 21 Jul 2020 16:44:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XbsdunOd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1731449AbgGUX32 (ORCPT + 99 others); Tue, 21 Jul 2020 19:29:28 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:47328 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgGUX3Z (ORCPT ); Tue, 21 Jul 2020 19:29:25 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06LNTPnF008444 for ; Tue, 21 Jul 2020 18:29:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1595374165; bh=M57k5GNdOhuFYfIUg8vfITWLthlh55K2f8tW0oPt63g=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XbsdunOdgIHRtKISife1AzQZ3TmsmOpjqDMvk4X+NSDForthxPpjrZG1Iy1pI3oBu 45ndBXQLrtm85awYCukuyrMGieqj3lMzd6e7MmzRw+nSpwNHy+7bVXa0e8zdP7AfGZ 3YEzcIevoKkg/2qmrTVmhtD9LCBmwLxgvraJOWpA= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06LNTOVq096967 for ; Tue, 21 Jul 2020 18:29:24 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 21 Jul 2020 18:29:24 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Tue, 21 Jul 2020 18:29:24 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06LNTNmm116815; Tue, 21 Jul 2020 18:29:23 -0500 From: Grygorii Strashko To: Kishon Vijay Abraham I CC: Sekhar Nori , , Grygorii Strashko Subject: [PATCH 2/3] phy: ti: gmii-sel: use features mask during init Date: Wed, 22 Jul 2020 02:29:12 +0300 Message-ID: <20200721232913.4979-3-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721232913.4979-1-grygorii.strashko@ti.com> References: <20200721232913.4979-1-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use features mask during PHYs initialization to simplify code. Signed-off-by: Grygorii Strashko --- drivers/phy/ti/phy-gmii-sel.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c index d4b02ad023b2..a6b7f22e85c4 100644 --- a/drivers/phy/ti/phy-gmii-sel.c +++ b/drivers/phy/ti/phy-gmii-sel.c @@ -147,13 +147,9 @@ static const struct reg_field phy_gmii_sel_fields_dra7[][PHY_GMII_SEL_LAST] = { { [PHY_GMII_SEL_PORT_MODE] = REG_FIELD(0x554, 0, 1), - [PHY_GMII_SEL_RGMII_ID_MODE] = REG_FIELD((~0), 0, 0), - [PHY_GMII_SEL_RMII_IO_CLK_EN] = REG_FIELD((~0), 0, 0), }, { [PHY_GMII_SEL_PORT_MODE] = REG_FIELD(0x554, 4, 5), - [PHY_GMII_SEL_RGMII_ID_MODE] = REG_FIELD((~0), 0, 0), - [PHY_GMII_SEL_RMII_IO_CLK_EN] = REG_FIELD((~0), 0, 0), }, }; @@ -174,8 +170,6 @@ static const struct reg_field phy_gmii_sel_fields_am654[][PHY_GMII_SEL_LAST] = { { [PHY_GMII_SEL_PORT_MODE] = REG_FIELD(0x4040, 0, 1), - [PHY_GMII_SEL_RGMII_ID_MODE] = REG_FIELD((~0), 0, 0), - [PHY_GMII_SEL_RMII_IO_CLK_EN] = REG_FIELD((~0), 0, 0), }, }; @@ -266,7 +260,7 @@ static int phy_gmii_init_phy(struct phy_gmii_sel_priv *priv, int port, if_phy->fields[PHY_GMII_SEL_PORT_MODE] = regfield; field = *fields++; - if (field.reg != (~0)) { + if (soc_data->features & BIT(PHY_GMII_SEL_RGMII_ID_MODE)) { regfield = devm_regmap_field_alloc(dev, priv->regmap, field); @@ -278,7 +272,7 @@ static int phy_gmii_init_phy(struct phy_gmii_sel_priv *priv, int port, } field = *fields; - if (field.reg != (~0)) { + if (soc_data->features & BIT(PHY_GMII_SEL_RMII_IO_CLK_EN)) { regfield = devm_regmap_field_alloc(dev, priv->regmap, field); -- 2.17.1