All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Peres <martin.peres-GANU6spQydw@public.gmane.org>
To: Karol Herbst <nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH v4 5/6] hwmon: don't require therm to be valid to get any data
Date: Sun, 21 Feb 2016 23:27:25 +0200	[thread overview]
Message-ID: <56CA2BBD.2090800@free.fr> (raw)
In-Reply-To: <1455988299-2300-6-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>


On 20/02/16 19:11, Karol Herbst wrote:
> Signed-off-by: Karol Herbst <nouveau@karolherbst.de>

Should never be an issue, but I get your point.

Reviewed-by: Martin Peres <martin.peres@free.fr>
> ---
>   drm/nouveau/nouveau_hwmon.c | 39 +++++++++++++++++++--------------------
>   1 file changed, 19 insertions(+), 20 deletions(-)
>
> diff --git a/drm/nouveau/nouveau_hwmon.c b/drm/nouveau/nouveau_hwmon.c
> index c4f77f5..a630192 100644
> --- a/drm/nouveau/nouveau_hwmon.c
> +++ b/drm/nouveau/nouveau_hwmon.c
> @@ -643,9 +643,6 @@ nouveau_hwmon_init(struct drm_device *dev)
>   		return -ENOMEM;
>   	hwmon->dev = dev;
>   
> -	if (!therm || !therm->attr_get || !therm->attr_set)
> -		return -ENODEV;
> -
>   	hwmon_dev = hwmon_device_register(&dev->pdev->dev);
>   	if (IS_ERR(hwmon_dev)) {
>   		ret = PTR_ERR(hwmon_dev);
> @@ -659,26 +656,28 @@ nouveau_hwmon_init(struct drm_device *dev)
>   	if (ret)
>   		goto error;
>   
> -	/* if the card has a working thermal sensor */
> -	if (nvkm_therm_temp_get(therm) >= 0) {
> -		ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup);
> -		if (ret)
> -			goto error;
> -	}
> -
> -	/* if the card has a pwm fan */
> -	/*XXX: incorrect, need better detection for this, some boards have
> -	 *     the gpio entries for pwm fan control even when there's no
> -	 *     actual fan connected to it... therm table? */
> -	if (therm->fan_get && therm->fan_get(therm) >= 0) {
> -		ret = sysfs_create_group(&hwmon_dev->kobj,
> -					 &hwmon_pwm_fan_attrgroup);
> -		if (ret)
> -			goto error;
> +	if (therm && therm->attr_get && therm->attr_set) {
> +		/* if the card has a working thermal sensor */
> +		if (nvkm_therm_temp_get(therm) >= 0) {
> +			ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup);
> +			if (ret)
> +				goto error;
> +		}
> +
> +		/* if the card has a pwm fan */
> +		/*XXX: incorrect, need better detection for this, some boards have
> +		 *     the gpio entries for pwm fan control even when there's no
> +		 *     actual fan connected to it... therm table? */
> +		if (therm->fan_get && therm->fan_get(therm) >= 0) {
> +			ret = sysfs_create_group(&hwmon_dev->kobj,
> +						 &hwmon_pwm_fan_attrgroup);
> +			if (ret)
> +				goto error;
> +		}
>   	}
>   
>   	/* if the card can read the fan rpm */
> -	if (nvkm_therm_fan_sense(therm) >= 0) {
> +	if (therm && nvkm_therm_fan_sense(therm) >= 0) {
>   		ret = sysfs_create_group(&hwmon_dev->kobj,
>   					 &hwmon_fan_rpm_attrgroup);
>   		if (ret)

_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2016-02-21 21:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-20 17:11 [PATCH v4 0/6] Suppor for various power sensors on GF100+ Karol Herbst
     [not found] ` <1455988299-2300-1-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-20 17:11   ` [PATCH v4 1/6] subdev/iccsense: add new subdev for power sensors Karol Herbst
     [not found]     ` <1455988299-2300-2-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:07       ` Martin Peres
2016-02-20 17:11   ` [PATCH v4 2/6] nvbios/iccsense: add parsing of the SENSE table Karol Herbst
     [not found]     ` <1455988299-2300-3-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:09       ` Martin Peres
2016-02-20 17:11   ` [PATCH v4 3/6] iccsense: implement for ina209, ina219 and ina3221 Karol Herbst
     [not found]     ` <1455988299-2300-4-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:21       ` Martin Peres
2016-02-20 17:11   ` [PATCH v4 4/6] hwmon: add power consumption Karol Herbst
     [not found]     ` <1455988299-2300-5-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:23       ` Martin Peres
2016-02-20 17:11   ` [PATCH v4 5/6] hwmon: don't require therm to be valid to get any data Karol Herbst
     [not found]     ` <1455988299-2300-6-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:27       ` Martin Peres [this message]
2016-02-20 17:11   ` [PATCH v4 6/6] bios/extdev: also parse v4.1 table Karol Herbst
     [not found]     ` <1455988299-2300-7-git-send-email-nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.org>
2016-02-21 21:28       ` Martin Peres

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=56CA2BBD.2090800@free.fr \
    --to=martin.peres-ganu6spqydw@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=nouveau-lIBOoy2+GI7scQ4cX5LuPg@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.