[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YoZT/QMLiWVVctKx@lunn.ch>
Date: Thu, 19 May 2022 16:28:13 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, Rob Herring <robh+dt@...nel.org>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, thomas.petazzoni@...tlin.com,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Richard Cochran <richardcochran@...il.com>,
Horatiu.Vultur@...rochip.com, Allan.Nielsen@...rochip.com,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next 4/6] net: phy: Add support for inband extensions
> +static int phy_set_inband_ext(struct phy_device *phydev, u32 mask, u32 ext)
> +{
> +/*
> + * TODO : Doc
> + */
> +enum {
> + __PHY_INBAND_EXT_PCH = 0,
> +};
I'm not so happy with this API passing masks and values, when you are
actually dealing with a feature which is a boolean, exists, does not
exist.
> +int phy_inband_ext_enable(struct phy_device *phydev, u32 ext);
> +int phy_inband_ext_disable(struct phy_device *phydev, u32 ext);
I would prefer enum phy_inband_ext ext;
phy_inband_ext_set_available(struct phy_device *phydev, enum phy_inband_ext ext);
and add
phy_inband_ext_set_unavailable(struct phy_device *phydev, enum phy_inband_ext ext);
Internally you can then turn these into operations on a u32.
Andrew
Powered by blists - more mailing lists