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 17FE8C433F5 for ; Wed, 6 Apr 2022 13:38:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D8D6483DB3; Wed, 6 Apr 2022 15:38:08 +0200 (CEST) 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="qLSM4EMY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4859283D97; Wed, 6 Apr 2022 15:38:07 +0200 (CEST) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) (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 2D2D083DB6 for ; Wed, 6 Apr 2022 15:38:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=olteanv@gmail.com Received: by mail-ej1-x62b.google.com with SMTP id yy13so4378534ejb.2 for ; Wed, 06 Apr 2022 06:38:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=uK6BFP1LsRk26yQvAEeViuzWdDoCIwFlkOoYJM0cr8M=; b=qLSM4EMYBgtUrF8yVIYYSOvs7bXuE0KeT0Xb9n/z+aH1O2hRnKWsqRW+E1+FELPROc 3+GukSX8r2a5McIcI3Jsiop0+f6pPPqIssg+afJi4OluuQB4uH8i9n9OIymXp2qgBP1J euYcvVpLW34ZD43WOg27thpNbxO+nfPPmrPJ9gKhIlIJiGXnNzx1APbS1LW+lVAsmVfK cro4OEPEu/pVKi2WVCoOOLBNC5bLu3SRvOKsOpEmQcZGF1Rz8jtlMwz882i5TH1EC7LW zfeqo3mivuOGpJQxi2lhByykXxJRi/HYuY3Te9sp8aysFyCLb81YDX/9vYNKmuBK4Nr0 UeWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=uK6BFP1LsRk26yQvAEeViuzWdDoCIwFlkOoYJM0cr8M=; b=IebIUEGAnbGbnFuW2GCGxLC+DTcNu9XGxSO8YJRIGm+5WT/k9qtOuP1KqTd/d5m5b9 D6GsoklJiBpy0uPTD7SmUajvz62qwnnwCR4WXu0JNqKd7EqlVkG5M1dTjHy8vz9640UU yF/oKVxTGj9p9t2yeTaRaUldho1fOWOHc1jmeipD1zHRVr1X35EkCIdRfWULJDNrKLRd qSGPX6hx2Grm3HHgXhCnzPUQaBkwQIjs2wb7M0E/G5reaXCS+a3VU0QwTOiH5eUr4IoP e/MJHH9g6YoS/2g3g02sHPUb5bdBxKFGP+7z4gOXqeVpD+lFZ/Gmpb6TkzhnLlc/wpdF n/AA== X-Gm-Message-State: AOAM533RuOB7vJnmTGAKCFMYXUN1OGWmtveb8WzAsst85iU7SZd5yFDW gk0unwccZ7pcW2JUCng9Mcbwp0oePqE= X-Google-Smtp-Source: ABdhPJwGVBFkV/zt7bY01jyB8XC/3GSUXksP5SLGogXwwaPmfcxNo4krmzsSSYqfY0+7PBqOQXmS0w== X-Received: by 2002:a17:907:9706:b0:6db:566a:4408 with SMTP id jg6-20020a170907970600b006db566a4408mr8298062ejc.374.1649252282096; Wed, 06 Apr 2022 06:38:02 -0700 (PDT) Received: from skbuf ([188.26.57.45]) by smtp.gmail.com with ESMTPSA id eq7-20020a056402298700b00419d8d46a8asm7670500edb.39.2022.04.06.06.38.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:38:01 -0700 (PDT) Date: Wed, 6 Apr 2022 16:38:00 +0300 From: Vladimir Oltean To: Marek =?utf-8?B?QmVow7pu?= Cc: Joe Hershberger , Ramon Fried , u-boot@lists.denx.de, Marek =?utf-8?B?QmVow7pu?= Subject: Re: [PATCH u-boot-net v3 14/14] net: phy: don't require PHY interface mode during PHY creation Message-ID: <20220406133800.mp55h5o63cppukpx@skbuf> References: <20220329200845.13435-1-kabel@kernel.org> <20220329200845.13435-15-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220329200845.13435-15-kabel@kernel.org> 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.5 at phobos.denx.de X-Virus-Status: Clean On Tue, Mar 29, 2022 at 10:08:45PM +0200, Marek Behún wrote: > From: Marek Behún > > Currently we require PHY interface mode to be known when > finding/creating the PHY - the functions > * phy_device_create() > * create_phy_by_mask() > * search_for_existing_phy() > * get_phy_device_by_mask() > * phy_find_by_mask() (this is the only one global) > all require the interface parameter, but the only thing done with it is > that it is assigned to phydev->interface. > > This makes it impossible to find a PHY device without overwriting the > set mode. > > Since the interface mode is not used during .probe() and should be used > at first in .config(), drop the interface parameter from these > functions. Make the default value of phydev->interface (in > phy_device_create()) to be PHY_INTERFACE_MODE_NA. Move the interface > parameter to phy_connect_dev(), where it should be. > > Change all occurrences treewide. In occurrences where we don't call > phy_connect_dev() for some reason (they only configure the PHY without > connecting it to an ethernet controller), set > phydev->interface = value from phy_find_by_mask call. > > Signed-off-by: Marek Behún > Reviewed-by: Ramon Fried > --- Reviewed-by: Vladimir Oltean