Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp785052ybl; Fri, 31 Jan 2020 07:59:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxbpFgI8wTokjdm1FnPs9ZlrTBH0vWbIrnNb0ivVtvaJVOrdZEXWJ8gcfUsngcMdAabEKlI X-Received: by 2002:a05:6830:138b:: with SMTP id d11mr7783975otq.38.1580486388510; Fri, 31 Jan 2020 07:59:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580486388; cv=none; d=google.com; s=arc-20160816; b=Sln5mGJiXlUlUI5YwTK1eb+0a7bnqJrXVZOrVmbJGKeTlHASBU3PxbH+JltzuKORYF Pa74ljWh0NosQtfMsoWHD6mll0aJX80Glw9hWl+1jNCYuOMfORtdi5s3d60zm8V6gaug wF/tS2DgB5bDnh90m0t8WYWHjPEBC8MqgduoFVzjsNpGeRTxMSmADSf1VozFgP3i0GQd 0bXi75LJVAGNEhJnbG1baopOzrC3sk53PQSWsb7xQGYIQdP6S7PzAjJ7mzYRjvhyE4h9 op+M+g+Vb+1W2qG/TUEL4SHVbUv5bYsI8opLfysow2huyUZQPktJD37zDPwMd4eOyYR0 Noiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sze0BBlw28/vvUMYTGMEhxjvTbDKyuD9mFgWdc6IiRQ=; b=hY4jyWAeWFU+o3PyQvkParEnzwNdKF21lQju7Cuh5pYLZ6kQUauOh79+U4XgpDYHNX 4VdkTxFQkJw/IfGLxMo/xJdBrzZJv3xSRMnS+h9KhSi2X1OzWd7haOlGJXNH2CEjIytB BbekaPu9KZy8hvP15DR8shsz2iA/lHzYzraUsN4TstjmLHOAqc0NTvzaR8mGUMwHB3rM Ku2MheyXa9OFHm1HpCVuiVRXMCeN5xqqcHNZjsvoDMCyiviT1TruxxbukiJ7KOUspUTV 60ZWr8lsUc8NE2xw2x4hs5gTYLouQhT9GqE/lOatCe/0C/1ebHhNMWZR1y8bwDoEjO7w aTIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uo7UO3Dz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id l14si4620043oii.37.2020.01.31.07.59.36; Fri, 31 Jan 2020 07:59:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Uo7UO3Dz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729260AbgAaP5n (ORCPT + 99 others); Fri, 31 Jan 2020 10:57:43 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46322 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728922AbgAaP5n (ORCPT ); Fri, 31 Jan 2020 10:57:43 -0500 Received: by mail-pg1-f196.google.com with SMTP id z124so3667924pgb.13 for ; Fri, 31 Jan 2020 07:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sze0BBlw28/vvUMYTGMEhxjvTbDKyuD9mFgWdc6IiRQ=; b=Uo7UO3DzvLTaGXorH5ASMuMVAooot3RsLFc6K9nCXDj3tcpoD8n1Fji9j5+9avoynY rnEGGuCOfVI2oO39NOFQgdfto1DzeuyK9kn2U/QQ4XRUId+RhsRITyS4dUXjA/R4YN8p rr1V2FtdglSWvLHfudEI20SUeDZqw49PtRjztb8DBiMijBS2s9PAp7iUZPfp6/QYrlNH dR6zExKY/DnYWgR9G07WKCh3yMC2x1IehCvSPtopK8ASHAg7ueBRFd2pL2uQ6Tuy4YO0 NGOSqYF2A88aBu1JFgKRsRWKVXRqk7gHzlESZPtj9j+gf9zJpXIM4dALqR0YM96+hYqT vnLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sze0BBlw28/vvUMYTGMEhxjvTbDKyuD9mFgWdc6IiRQ=; b=CJuvVQQznR7XFETG/WPPcmxVfOpGSqfIhD+pDHdsKuvN25JA0Aoel64F94U+E+rSHz eZgc490mdX5eX6bQuNZqkwRZoCF2SHC16lwo6umS9MtrToKRxnQz1BSo/lE2+H+2OE5d qLssoC3AaLNxa94VK/C5eMcPiuqKx+vlnxAGPd9QfTvpkMpA9DJkh6qjbGmEg62msY/c choT5aokJPyZg9sJRUMcRXGlAPl+dVBKrL/zW51Fo5xs4GGKG7G8OXZyO3s9yckcFp4l 9pu6S3miaCfnv++msHBQive4BnTJPjcv+L/fXRaMsj3Sj75djc+5fWMsxSCuimxBbo/7 nmmQ== X-Gm-Message-State: APjAAAXFnROscmQtiMshI8W8rDH47ZfNUwEYLLIPSlqwC+w79jSXMPZl hcvYtt9/TbLTca8ii3nUWbY3ODSflPyf2vB42r0= X-Received: by 2002:a65:5242:: with SMTP id q2mr10715791pgp.74.1580486262778; Fri, 31 Jan 2020 07:57:42 -0800 (PST) MIME-Version: 1.0 References: <20200131153440.20870-1-calvin.johnson@nxp.com> <20200131153440.20870-6-calvin.johnson@nxp.com> In-Reply-To: <20200131153440.20870-6-calvin.johnson@nxp.com> From: Andy Shevchenko Date: Fri, 31 Jan 2020 17:57:34 +0200 Message-ID: Subject: Re: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link() To: Calvin Johnson Cc: linux.cj@gmail.com, Jon Nettleton , Russell King - ARM Linux , Makarand Pawagi , cristian.sovaiala@nxp.com, laurentiu.tudor@nxp.com, ioana.ciornei@nxp.com, V.Sethi@nxp.com, pankaj.bansal@nxp.com, "Rajesh V . Bikkina" , Calvin Johnson , Andy Shevchenko , Dmitry Torokhov , Greg Kroah-Hartman , Heikki Krogerus , "Rafael J. Wysocki" , Sakari Ailus , Thomas Gleixner , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson wrote: > > From: Calvin Johnson > > Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver > can call on its PHY phandle to find out whether it's a fixed link PHY > or not. > +/* > + * fwnode_phy_is_fixed_link() > + */ Please, do a full kernel doc description. > +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode) > +{ > + struct fwnode_handle *fixed_node; > + int len, err; > + const char *managed; > + > + fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link"); > + if (fixed_node) > + return fixed_node; > + > + err = fwnode_property_read_string(fixed_node, "managed", &managed); > + if (err == 0 && strcmp(managed, "auto") != 0) > + return true; > + > + return false; Maybe other way around? if (err) return false; return !strcmp(managed, "auto"); ? Same pattern perhaps for the patch where you introduce fwnode_get_phy_mode(). > +} -- With Best Regards, Andy Shevchenko