Subject: Re: [PATCH net-next 1/2] phy: marvell: Add support for temperature sensor

From: Andrew Lunn <[email-masked]>
Date: Wed, 11 Jan 2017 16:09:31 +0100

> +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