[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7827301e-71bb-ad93-d6fa-350dcb5afd29@cogentembedded.com>
Date: Wed, 11 Jan 2017 19:29:20 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Andrew Lunn <andrew@...n.ch>, 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
Hello!
On 01/11/2017 06:09 PM, Andrew Lunn wrote:
>> +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);
PTR_ERR_OR_ZERO() maybe?
[...]
MBR, Sergei
Powered by blists - more mailing lists