From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A8E5C43217 for ; Sat, 26 Nov 2022 22:50:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 77D60851EA; Sat, 26 Nov 2022 23:50:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f7r7dnUM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0B4B9851EB; Sat, 26 Nov 2022 23:50:31 +0100 (CET) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 94B688515B for ; Sat, 26 Nov 2022 23:50:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-wr1-x42b.google.com with SMTP id g12so11438736wrs.10 for ; Sat, 26 Nov 2022 14:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ft/OYLi0x5mUF6d2JZUsKNIscMGSjbS0AMLuwUwvOVo=; b=f7r7dnUMsu5WWfmGx7WzbLILLawGo38Vumg2NA5Fiw/fxJQbidY6tJ1l+mnEROYnQL wPHDzAqX2PSaYeVdguzEw401U9yxVw1RNiAS7wMIkmBZT6MFj6IaBuzQasjBbLM3NLmz 5a/69kG2/FsI8QrJC3tgd0etJQq1hwiaSlOrTcWCRdgrYraJj5XlEedCmVS+xx84QGB+ VVaPjMG0lCZHYSPJYouUNBLLazP1odCBWOk5m9cdOsiYkfj4l/6goSEdpFk8FUc0A5X3 7yE52eTDVIM0DAaJZYP21vFSIqwtzVtUE+1YB34w+Niu4vuzl3YWfpTV43IoT6E+5GGu fumg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ft/OYLi0x5mUF6d2JZUsKNIscMGSjbS0AMLuwUwvOVo=; b=7ZScziFfaR3PffO+EVZ/sZcsvCC4+py9ruwYzdt6VL7hxZjlik7c6Sd7IL7xpS6Zm8 lIS1ZM6xEK9dgUTpWhkCZDBF1Cd4bBO391XFuQL5cSrRBevSHibLOCm7EaJyGW+7LUVq ALKZNUqwcDbEA7RYnGqdYr6oYDFzmKhuxiNgXIk6Mq6CL2QPOCqAyS5bkNfYB9VwVFCf OUUYBtGmJyB6Cr+OCJppL2zjFuJqQBMyRrp1JBFPo+/QxGPLaokSDyfpOQgqKnfjGJMu SOAYmgD1/vP7R8vw//RNu3+a4OSRPSOTY806FuZ33EQ5fgmC+j97W621SUE3YxObI8Bt eciw== X-Gm-Message-State: ANoB5pmRQ/e128pwqGsTvp4A96RpaiI9fihVgTDviYLt43NOJTHXRPhK A+A9IoL4eBi84fgx/UaVd5PHrMtJYSlqwCY8Qg4mesqGHlE= X-Google-Smtp-Source: AA0mqf4jOvOKO+0FPKp77MPJS54i4/yXWJkHEYxg14kmI1CXCnpSGhxgMMkWL91qw5cDCMPqjBJyQ9JT/hUumj5FCTY= X-Received: by 2002:adf:ef89:0:b0:22a:f477:7bb6 with SMTP id d9-20020adfef89000000b0022af4777bb6mr27221466wro.390.1669503027173; Sat, 26 Nov 2022 14:50:27 -0800 (PST) MIME-Version: 1.0 References: <20221122144101.21048-1-jit.loon.lim@intel.com> In-Reply-To: <20221122144101.21048-1-jit.loon.lim@intel.com> From: Ramon Fried Date: Sun, 27 Nov 2022 00:50:16 +0200 Message-ID: Subject: Re: [PATCH] net: phy: micrel: Get phy node from phy-handle To: Jit Loon Lim Cc: u-boot@lists.denx.de, Jagan Teki , Vignesh R , Marek , Simon , Tien Fong , Kok Kiang , Siew Chin , Sin Hui , Raaj , Dinesh , Boon Khai , Alif , Teik Heng , Hazim , Sieu Mun Tang , Ley Foon Tan Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Tue, Nov 22, 2022 at 4:41 PM Jit Loon Lim wrote: > > From: Ley Foon Tan > > HSD #1509063521: Try to get phy node from "phy-handle" if can't find ethernet-phy subnode. What is this HSD ? Intel internal ? Please remove. > Lastly only use Ethernet node if can't find phy node from ethernet-phy > subnode and phy-handle. > > Signed-off-by: Ley Foon Tan > Signed-off-by: Jit Loon Lim > --- > drivers/net/phy/micrel_ksz90x1.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/phy/micrel_ksz90x1.c b/drivers/net/phy/micrel_ksz90x1.c > index e5f578201f..e33789b7f7 100644 > --- a/drivers/net/phy/micrel_ksz90x1.c > +++ b/drivers/net/phy/micrel_ksz90x1.c > @@ -112,6 +112,7 @@ static int ksz90x1_of_config_group(struct phy_device *phydev, > { > struct udevice *dev = phydev->dev; > struct phy_driver *drv = phydev->drv; > + struct ofnode_phandle_args phandle; > int val[4]; > int i, changed = 0, offset, max; > u16 regval = 0; > @@ -128,8 +129,14 @@ static int ksz90x1_of_config_group(struct phy_device *phydev, > } > > if (!ofnode_valid(node)) { > - /* No node found, look in the Ethernet node */ > - node = dev_ofnode(dev); > + if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, > + &phandle)) { > + /* No phy-handle found, look in the Ethernet node */ > + node = dev_ofnode(dev); > + } else { > + /* phy-handle found */ > + node = phandle.node; > + } > } > > for (i = 0; i < ofcfg->grpsz; i++) { > -- > 2.26.2 >