lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] hwmon: pwm-fan: Add profile support and add remove module support
From
Date
On 5/25/20 10:06 PM, Sandipan Patra wrote:
> This change has 2 parts:
> 1. Add support for profiles mode settings.
> This allows different fan settings for trip point temp/hyst/pwm.
> T194 has multiple fan-profiles support.
>
> 2. Add pwm-fan remove support. This is essential since the config is
> tristate capable.
>
> Signed-off-by: Sandipan Patra <spatra@nvidia.com>
> ---
> drivers/hwmon/pwm-fan.c | 112 ++++++++++++++++++++++++++++++++++++++++++------
> 1 file changed, 100 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> index 30b7b3e..26db589 100644
> --- a/drivers/hwmon/pwm-fan.c
> +++ b/drivers/hwmon/pwm-fan.c

[ ... ]

>
> +static int pwm_fan_remove(struct platform_device *pdev)
> +{
> + struct pwm_fan_ctx *ctx = platform_get_drvdata(pdev);
> + struct pwm_args args;
> +
> + if (!ctx)
> + return -EINVAL;
> +
> + if (IS_ENABLED(CONFIG_THERMAL))
> + thermal_cooling_device_unregister(ctx->cdev);
> +
> + pwm_get_args(ctx->pwm, &args);
> + pwm_config(ctx->pwm, 0, args.period);
> + pwm_disable(ctx->pwm);
> +
> + return 0;
> +}
> +

I don't think you actually tested this. I would suggest to make
yourself familiar with 'devm' functions and their use, and
then resubmit.

Thanks,
Guenter

\
 
 \ /
  Last update: 2020-05-26 13:42    [W:1.554 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site