[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170111150931.GV22820@lunn.ch>
Date: Wed, 11 Jan 2017 16:09:31 +0100
From: Andrew Lunn <andrew@...n.ch>
To: David Miller <davem@...emloft.net>
Cc: netdev <netdev@...r.kernel.org>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH net-next 1/2] phy: marvell: Add support for temperature
sensor
> +static int marvell_hwmon_probe(struct phy_device *phydev,
> + const struct hwmon_chip_info *chip)
> +{
> + struct marvell_priv *priv = phydev->priv;
> + struct device *dev = &phydev->mdio.dev;
> + int err;
> +
> + err = marvell_hwmon_name(phydev);
> + if (err)
> + return err;
> +
> + priv->hwmon_dev = devm_hwmon_device_register_with_info(
> + dev, priv->hwmon_name, phydev, chip, NULL);
> +
> + if (IS_ERR(priv->hwmon_dev))
> + return PTR_ERR(priv->hwmon_dev);
> +
> + return 0;
> +}
0-day has pointed out this can be simplified to just
return PTR_ERR(priv->hwmon_dev);
I will submit a v2 in a couple of days, when others have had chance to
comment.
Andrew
Powered by blists - more mailing lists