Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp472097pxj; Fri, 11 Jun 2021 03:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDpwb10GBGjbPL7aycPKRTGgQPdgu3Ywg+w+sI+ESR69vwlvP1/IeyJoAMIXZGcuZMopgh X-Received: by 2002:a17:906:17d8:: with SMTP id u24mr3168317eje.106.1623409089618; Fri, 11 Jun 2021 03:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623409089; cv=none; d=google.com; s=arc-20160816; b=zYuCO6rj96Rn6gaeUYRIKoiNLVjstc2yIBRpgXFs0lWGDGCOEOpXZRbpYNl3J/bX5S wWnB2sP9bSOX9RuO5HjWTHHwBRdiVEFkPuP4jhOP5IB+MzKedCqHcs7I9jsr69yePKDG k8VlKt4N0sCBtQzDf1B3vkFUL7Mt7aj7gXvDOIORFdh4K7wfcuwZuWfFDRk+bXk71u6V LUfq3sLlMuPGqIkC3pUCqLQVe5krpO3fsMyNvnPbaACsXuVrdp5TmUFc20N13D8HFU+G U6VSAfYQZVxph2iscd2hR6FohdvBfLrDvtgD2X7JSr0eQC6MjZjkp2ND/cK361hRKYKZ 24nw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eoEA0ne+e+Uq92kZIc2aEzTZghhWH4bSeSYhHLqXXxM=; b=c9CUo+Gq0pAdrJ1Z5pkMLjgEFzjaOkl5QuWG8NXDjr7AnXrtAjyL+gx9gvkBNsUhY/ MfWGd9iHlHecRJ7e5nbqmzJ6MXYr6bMOuziZAhEmYu4uoZTelCGppHpk0VnpUHGdS4DR AJwD1rFo6RGqVRLlYYnY2+ia3Y4GnqMBvaQ3DEgjL3PtYGULX60svk0WUDgKH+eY96t1 3HAZnC0mEVqAMjrt8NGA/CP+gm6iIEyivDoxud56fYSPg/RZ5oPsQQXEWh35jxLSw2NB LExf93JQ8+H0NLhT2QRG0jAxC5FNEn6yyEXHMoQ1/upJVknaks7feLx3PEjbQzG5Olyq 95vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sHqKdDjF; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb24si4771461ejb.84.2021.06.11.03.57.47; Fri, 11 Jun 2021 03:58: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=@gmail.com header.s=20161025 header.b=sHqKdDjF; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbhFKK5K (ORCPT + 99 others); Fri, 11 Jun 2021 06:57:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbhFKK5A (ORCPT ); Fri, 11 Jun 2021 06:57:00 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1A9C061574; Fri, 11 Jun 2021 03:55:00 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id u24so36580205edy.11; Fri, 11 Jun 2021 03:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eoEA0ne+e+Uq92kZIc2aEzTZghhWH4bSeSYhHLqXXxM=; b=sHqKdDjFsA1hnSBUEmEiHIUdBEHbS1nZ+f18RdWCwvjfPZZspcwa+AuBN0TVjSGkKY 5EhZYOSOKc4RHtdYuqt+dfb+1VRUp/aKRdw2vGei2B6HDL8+QoNgZRbjVFrKqSAE8ilj AKf+5o6HVnSlWp0oyR+rDWcAyOEfT9/EGLlrlgZpWZmdxmJwlz7Dek/4AcYyjNHX3qQy lEAkYoAaOfujma9x2KBt49CdkKOW9nYjR2lJaC9taulnP1nyqDGTQsjuN9Cwb9wNz0Ex BuBHvNV8bKH3EIt6Y/GpJO/7eaRbHe9p3cZSGmLzlVXQybOMrpMGfJpAQRsfoIoDwQce 3o4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eoEA0ne+e+Uq92kZIc2aEzTZghhWH4bSeSYhHLqXXxM=; b=cl/qjvSvaKqNLMNp7TrMk9t/QY4o/Ua2/D86GagrJdV6/60p4oEN7LW6RChqZL4+wQ Lgqzp9ZZJlpPrKl9dUszkDlJZlVF2yGq2KmGpRZdECfcgCE28lwlqyvgtlQngE4h5LGK QfEAjXt/SU2jgwgmGEF+jaTayXOIjyO5KQd6iuif4qyZQtwr73yiWeeSRVTgM9tPxQOX lXqZOqDY3+vcwQOYq9F9g8CMDARFN/3kJfWPLkAryuE1V/Wk6qv9afMfjPiVZYhu8x0U LrJ1EBNqfe6fd8aG7OQaY2AfanOscsVCiHTB6zzRQyHFUTNO2Cn2rI+5E20hvIRFalCB crpQ== X-Gm-Message-State: AOAM533Be7HkV9HuQeUyqWBWGxUXqaefQ7i0+fmwgoTkrRZeheB+WM5Y fIImuqE/xAC6Ue+zb7ifp7N5ARWQd8Nv/jVb X-Received: by 2002:a05:6402:781:: with SMTP id d1mr3193416edy.32.1623408898584; Fri, 11 Jun 2021 03:54:58 -0700 (PDT) Received: from yoga-910.localhost ([188.26.52.84]) by smtp.gmail.com with ESMTPSA id r19sm2492051eds.75.2021.06.11.03.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 03:54:58 -0700 (PDT) From: Ioana Ciornei To: davem@davemloft.net, kuba@kernel.org, hkallweit1@gmail.com, netdev@vger.kernel.org, Grant Likely , "Rafael J . Wysocki" , Jeremy Linton , Andrew Lunn , Andy Shevchenko , Florian Fainelli , Russell King - ARM Linux admin , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , calvin.johnson@oss.nxp.com Cc: Cristi Sovaiala , Florin Laurentiu Chiculita , Madalin Bucur , linux-arm-kernel@lists.infradead.org, Diana Madalina Craciun , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux.cj@gmail.com, Laurentiu Tudor , Len Brown , "Rafael J . Wysocki" , Ioana Ciornei Subject: [PATCH net-next v9 06/15] of: mdio: Refactor of_get_phy_id() Date: Fri, 11 Jun 2021 13:53:52 +0300 Message-Id: <20210611105401.270673-7-ciorneiioana@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210611105401.270673-1-ciorneiioana@gmail.com> References: <20210611105401.270673-1-ciorneiioana@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Calvin Johnson With the introduction of fwnode_get_phy_id(), refactor of_get_phy_id() to use fwnode equivalent. Signed-off-by: Calvin Johnson Signed-off-by: Ioana Ciornei Acked-by: Grant Likely --- Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/net/mdio/of_mdio.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c index 0ba1158796d9..29f121cba314 100644 --- a/drivers/net/mdio/of_mdio.c +++ b/drivers/net/mdio/of_mdio.c @@ -29,17 +29,7 @@ MODULE_LICENSE("GPL"); * ethernet-phy-idAAAA.BBBB */ static int of_get_phy_id(struct device_node *device, u32 *phy_id) { - struct property *prop; - const char *cp; - unsigned int upper, lower; - - of_property_for_each_string(device, "compatible", prop, cp) { - if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { - *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); - return 0; - } - } - return -EINVAL; + return fwnode_get_phy_id(of_fwnode_handle(device), phy_id); } static struct mii_timestamper *of_find_mii_timestamper(struct device_node *node) -- 2.31.1