Message ID | 20200622093744.13685-9-brgl@bgdev.pl (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=eeZ+=AD=lists.infradead.org=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B87B161F for <patchwork-linux-mediatek@patchwork.kernel.org>; Mon, 22 Jun 2020 14:57:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 643FF20708 for <patchwork-linux-mediatek@patchwork.kernel.org>; Mon, 22 Jun 2020 14:57:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mOSxDX/Q"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="UtNEe+Y7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 643FF20708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zsOhIgoDWorWuDMnTzrP2lCey1rxBQNaddhkaruJzFY=; b=mOSxDX/QW7RlRtqL2wpKmBL5g dm0FbfQoScUMdbiVAcpP7IItD7q1gPp8OjQosZ5VmIiklS8OSkweKB3BJrF1MI+Thg258JLM0va5h JE3Kv3yfF3eMeeA1tkn7TpwtMbBL3BVK1SQh0St/+6Osu5EjsI/RYXyDSteWJJgyP725QA1NOhCAW w6A7bk28rtVBvW0paKN/MOw916ItQQutf+NGeTRaUKXhzg06BL26czyuRmoQiU7YAZ+j5GBXjvCvW dDOj+bCadpoiN4gYIIiQrqjVOfwUw3S2zsby8ONNNN0xG9GGpcV4vt+6b8B4i6sBYXcyYOjsxn13v Vda8LaDOQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnNsj-0003Ok-3m; Mon, 22 Jun 2020 14:57:09 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnIxN-0007h3-Lp for linux-mediatek@lists.infradead.org; Mon, 22 Jun 2020 09:41:38 +0000 Received: by mail-wr1-x444.google.com with SMTP id k6so3483380wrn.3 for <linux-mediatek@lists.infradead.org>; Mon, 22 Jun 2020 02:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yy6XgmLu+rdPXztYG22qHG3UQylFLO0aZanRZZZSG+U=; b=UtNEe+Y7D5ArH7Qe/vs7TUd5yHPcILffWoYh4wTCQdtMBq36DtKsydxvi6z3a7HbGS FB2blBliY4Y+cVZyVIBbNCz/TMBZbmhI+WrSDUrAZc+nT9RqNVT9ahaolMbn+oxd3MXf 1G7L1Tcb6rs72hInUAFR8sZDDUZyVq9WQ8aEF0wR9UhVHcEeuUBRsA99mkWAfVG8D7Fm zKsJUFL1xKBJ0gZxZlQvxrVGukdEa54zY4pSR0TYGGrqagLXr4OzxpZFMV8ttxXXVHQU uiUpPpCNqmeepGbSEiBWxIRbMBVFfKFJKOIFmK8bRZsbBYVxA3/rlPTyqTaIaGU38MYj ac8w== 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=yy6XgmLu+rdPXztYG22qHG3UQylFLO0aZanRZZZSG+U=; b=qxL4hwk50tPdh5E6OoJmCRitTeW/p/crBSeIlZZF5aucXE/jj5ORdDyQV29lMq25bs KcRq61Dx1VVA9gdpMYmhTzpGwQvLBhHtMAxyr0IsSWXzdN+0i9SygEROMqEvdxLCOTYl ejMFqhTMNBSGAn8t08hxW/dgaPn/zfF953IX69mEgskM/GAqIEPglQZloxtYKPopnBAP mNs687Ms9v29+smVjWbz6yKAK+9HxW+JlMkkv6oIX2h1t4g0GpXzFvlEbAE3f3b/cZ70 0yXMPkijkpgHhATaM8RWOjRNvYIfCLfDWkAhLowWrrKe1kHnH2KYGDFm/eNpxBBhTgay ItGw== X-Gm-Message-State: AOAM532WExjwQ4oxxHRFefl3l9wfXCV4EAToAhXbSD6nSgTCEtXBRtTO UNgO1oN/VFZYNg5Tq+jgFsiupA== X-Google-Smtp-Source: ABdhPJyFGfPZiEZAaPA05Oy9u/8YECmNenqKkrnMxPg4aIkaLDansk5+kyg8mkF5tPJf9KrUB0gUSQ== X-Received: by 2002:a5d:6987:: with SMTP id g7mr17998302wru.79.1592818896247; Mon, 22 Jun 2020 02:41:36 -0700 (PDT) Received: from localhost.localdomain (lfbn-nic-1-65-232.w2-15.abo.wanadoo.fr. [2.15.156.232]) by smtp.gmail.com with ESMTPSA id j24sm14392652wrd.43.2020.06.22.02.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 02:41:35 -0700 (PDT) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S . Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Rob Herring <robh+dt@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>, Vladimir Oltean <vladimir.oltean@nxp.com>, Claudiu Manoil <claudiu.manoil@nxp.com>, Alexandre Belloni <alexandre.belloni@bootlin.com>, Vivien Didelot <vivien.didelot@gmail.com>, Tom Lendacky <thomas.lendacky@amd.com>, Yisen Zhuang <yisen.zhuang@huawei.com>, Salil Mehta <salil.mehta@huawei.com>, Jassi Brar <jaswinder.singh@linaro.org>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, Iyappan Subramanian <iyappan@os.amperecomputing.com>, Keyur Chudgar <keyur@os.amperecomputing.com>, Quan Nguyen <quan@os.amperecomputing.com>, Frank Rowand <frowand.list@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org> Subject: [PATCH 08/15] net: phy: check the PHY presence in get_phy_id() Date: Mon, 22 Jun 2020 11:37:37 +0200 Message-Id: <20200622093744.13685-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200622093744.13685-1-brgl@bgdev.pl> References: <20200622093744.13685-1-brgl@bgdev.pl> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-mediatek.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-mediatek>, <mailto:linux-mediatek-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-mediatek/> List-Post: <mailto:linux-mediatek@lists.infradead.org> List-Help: <mailto:linux-mediatek-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-mediatek>, <mailto:linux-mediatek-request@lists.infradead.org?subject=subscribe> Cc: devicetree@vger.kernel.org, Stephane Le Provost <stephane.leprovost@mediatek.com>, Bartosz Golaszewski <bgolaszewski@baylibre.com>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabien Parent <fparent@baylibre.com>, linux-mediatek@lists.infradead.org, Andrew Perepech <andrew.perepech@mediatek.com>, Pedro Tsai <pedro.tsai@mediatek.com>, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" <linux-mediatek-bounces@lists.infradead.org> Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org |
Series |
net: phy: correctly model the PHY voltage supply in DT
|
expand
|
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 8037a9663a85..eccbf6aea63d 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -806,6 +806,10 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, *phy_id |= phy_reg; + /* If the phy_id is mostly Fs, there is no device there */ + if ((*phy_id & 0x1fffffff) == 0x1fffffff) + return -ENODEV; + return 0; } @@ -832,10 +836,6 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45) if (r) return ERR_PTR(r); - /* If the phy_id is mostly Fs, there is no device there */ - if ((phy_id & 0x1fffffff) == 0x1fffffff) - return ERR_PTR(-ENODEV); - return phy_device_create(bus, addr, phy_id, is_c45, &c45_ids); } EXPORT_SYMBOL(get_phy_device);