All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <deathsimple@vodafone.de>
To: Alex Deucher <alexdeucher@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>, stable@vger.kernel.org
Subject: Re: [PATCH 1/4] drm/radeon: properly unregister hwmon interface (v2)
Date: Tue, 22 Apr 2014 16:51:48 +0200	[thread overview]
Message-ID: <53568204.1070209@vodafone.de> (raw)
In-Reply-To: <1397580275-11967-1-git-send-email-alexander.deucher@amd.com>

Am 15.04.2014 18:44, schrieb Alex Deucher:
> Need to properly unregister the hwmon device on driver
> unload.
>
> v2: minor clean up
>
> bug:
> https://bugzilla.kernel.org/show_bug.cgi?id=73931
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org

Added to my 3.15 queue.

Sorry for the delay, those patches somehow got lost in my inbox.

Christian.

> ---
>   drivers/gpu/drm/radeon/radeon_pm.c | 21 +++++++++++++++------
>   1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
> index ee738a5..e0a664d 100644
> --- a/drivers/gpu/drm/radeon/radeon_pm.c
> +++ b/drivers/gpu/drm/radeon/radeon_pm.c
> @@ -603,7 +603,6 @@ static const struct attribute_group *hwmon_groups[] = {
>   static int radeon_hwmon_init(struct radeon_device *rdev)
>   {
>   	int err = 0;
> -	struct device *hwmon_dev;
>   
>   	switch (rdev->pm.int_thermal_type) {
>   	case THERMAL_TYPE_RV6XX:
> @@ -616,11 +615,11 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
>   	case THERMAL_TYPE_KV:
>   		if (rdev->asic->pm.get_temperature == NULL)
>   			return err;
> -		hwmon_dev = hwmon_device_register_with_groups(rdev->dev,
> -							      "radeon", rdev,
> -							      hwmon_groups);
> -		if (IS_ERR(hwmon_dev)) {
> -			err = PTR_ERR(hwmon_dev);
> +		rdev->pm.int_hwmon_dev = hwmon_device_register_with_groups(rdev->dev,
> +									   "radeon", rdev,
> +									   hwmon_groups);
> +		if (IS_ERR(rdev->pm.int_hwmon_dev)) {
> +			err = PTR_ERR(rdev->pm.int_hwmon_dev);
>   			dev_err(rdev->dev,
>   				"Unable to register hwmon device: %d\n", err);
>   		}
> @@ -632,6 +631,12 @@ static int radeon_hwmon_init(struct radeon_device *rdev)
>   	return err;
>   }
>   
> +static void radeon_hwmon_fini(struct radeon_device *rdev)
> +{
> +	if (rdev->pm.int_hwmon_dev)
> +		hwmon_device_unregister(rdev->pm.int_hwmon_dev);
> +}
> +
>   static void radeon_dpm_thermal_work_handler(struct work_struct *work)
>   {
>   	struct radeon_device *rdev =
> @@ -1353,6 +1358,8 @@ static void radeon_pm_fini_old(struct radeon_device *rdev)
>   		device_remove_file(rdev->dev, &dev_attr_power_method);
>   	}
>   
> +	radeon_hwmon_fini(rdev);
> +
>   	if (rdev->pm.power_state)
>   		kfree(rdev->pm.power_state);
>   }
> @@ -1372,6 +1379,8 @@ static void radeon_pm_fini_dpm(struct radeon_device *rdev)
>   	}
>   	radeon_dpm_fini(rdev);
>   
> +	radeon_hwmon_fini(rdev);
> +
>   	if (rdev->pm.power_state)
>   		kfree(rdev->pm.power_state);
>   }

      parent reply	other threads:[~2014-04-22 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 16:44 [PATCH 1/4] drm/radeon: properly unregister hwmon interface (v2) Alex Deucher
2014-04-15 16:44 ` [PATCH 2/4] drm/radeon/pm: don't walk the crtc list before it has been initialized (v2) Alex Deucher
2014-04-15 16:44 ` [PATCH 3/4] drm/radeon: fix ATPX detection on non-VGA GPUs Alex Deucher
2014-04-15 16:44 ` [PATCH 4/4] drm/radeon: don't allow runpm=1 on systems with out ATPX Alex Deucher
2014-04-22 14:51 ` Christian König [this message]

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=53568204.1070209@vodafone.de \
    --to=deathsimple@vodafone.de \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=stable@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 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.