lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 May 2021 22:56:44 +0100
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     Peter Geis <pgwipeout@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org, linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH] net: phy: add driver for Motorcomm yt8511 phy

Hi,

On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
> +static int yt8511_config_init(struct phy_device *phydev)
> +{
> +	int ret, val, oldpage;
> +
> +	/* set clock mode to 125mhz */
> +	oldpage = phy_select_page(phydev, YT8511_EXT_CLK_GATE);
> +	if (oldpage < 0)
> +		goto err_restore_page;
> +
> +	val = __phy_read(phydev, YT8511_PAGE);
> +	val |= (YT8511_CLK_125M);
> +	ret = __phy_write(phydev, YT8511_PAGE, val);

Please consider __phy_modify(), and handle any error it returns.

> +
> +	/* disable auto sleep */
> +	ret = __phy_write(phydev, YT8511_PAGE_SELECT, YT8511_EXT_SLEEP_CTRL);

Please consider handling a failure to write here.

> +	val = __phy_read(phydev, YT8511_PAGE);
> +	val &= (~BIT(15));
> +	ret = __phy_write(phydev, YT8511_PAGE, val);

Also a use for __phy_modify().

> +
> +err_restore_page:
> +	return phy_restore_page(phydev, oldpage, ret);
> +}
> +
> +static struct phy_driver motorcomm_phy_drvs[] = {
> +	{
> +		PHY_ID_MATCH_EXACT(PHY_ID_YT8511),
> +		.name		= "YT8511 Gigabit Ethernet",
> +		.config_init	= &yt8511_config_init,

Please drop the '&' here, it's unnecessary.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ