netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: phy: marvell: mv88e6390 temperature sensor reading
Date: Wed, 10 Jan 2018 09:49:03 -0800	[thread overview]
Message-ID: <7eb569f8-ad27-3a28-17e9-461bf9acd1af@gmail.com> (raw)
In-Reply-To: <20180110140559.GB32117@lunn.ch>

On 01/10/2018 06:05 AM, Andrew Lunn wrote:
>>>> +static int m88e6390_hwmon_probe(struct phy_device *phydev)
>>>> +{
>>>> +	return marvell_hwmon_probe(phydev, &m88e6390_hwmon_chip_info);
>>>> +}
>>>>  #else
>>>>  static int m88e1121_hwmon_probe(struct phy_device *phydev)
>>>>  {
>>>> @@ -1794,6 +1927,11 @@ static int m88e1510_hwmon_probe(struct phy_device *phydev)
>>>>  {
>>>>  	return 0;
>>>>  }
>>>> +
>>>> +static int m88e6390_hwmon_probe(struct phy_device *phydev)
>>>> +{
>>>> +	return 0;
>>>> +}
>>>
>>> Instead of having to define m88e6390_hwmon_probe() twice, I would just
>>> make marvell_hwmon_probe() a stub when CONFIG_HWMON=n?
>>
>> Yes, i could do that. But again, i'm just following the pattern from
>> the other two sensors.
> 
> Humm, actually, no. It makes it more complex. If marvell_hwmon_probe()
> is a stub, and we keep m88e6390_hwmon_probe() as the real
> implementation, it means we need m88e6390_hwmon_chip_info, so we can
> pass it. Either i need a stub version of m88e6390_hwmon_chip_info, or
> i just build all the hwmon code even when CONFIG_HWMON is
> disabled. The compiler might be able to figure out it is all unused
> and throw it away, but i doubt it.
> 
> Having m88e6390_hwmon_probe() a stub is much simpler.

Fair enough:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  reply	other threads:[~2018-01-10 17:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 21:42 [PATCH net-next] net: phy: marvell: mv88e6390 temperature sensor reading Andrew Lunn
2018-01-10  0:14 ` Florian Fainelli
2018-01-10 13:52   ` Andrew Lunn
2018-01-10 14:05     ` Andrew Lunn
2018-01-10 17:49       ` Florian Fainelli [this message]
2018-01-10 20:35 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7eb569f8-ad27-3a28-17e9-461bf9acd1af@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).