Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932538AbbBZONA (ORCPT ); Thu, 26 Feb 2015 09:13:00 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:45456 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932084AbbBZOM7 (ORCPT ); Thu, 26 Feb 2015 09:12:59 -0500 Message-ID: <54EF29D4.7040508@roeck-us.net> Date: Thu, 26 Feb 2015 06:12:36 -0800 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Lukasz Majewski , Eduardo Valentin , Kamil Debski , Jean Delvare , Kukjin Kim CC: lm-sensors@lm-sensors.org, Linux PM list , "linux-samsung-soc@vger.kernel.org" , devicetree@vger.kernel.org, Lukasz Majewski , Kukjin Kim , linux-kernel@vger.kernel.org, Sjoerd Simons , Abhilash Kesavan , Abhilash Kesavan Subject: Re: [PATCH v6 6/6] hwmon: pwm-fan: Code for using PWM FAN as a cooling device References: <1418897591-18332-1-git-send-email-l.majewski@samsung.com> <1424959177-28739-1-git-send-email-l.majewski@samsung.com> <1424959177-28739-7-git-send-email-l.majewski@samsung.com> In-Reply-To: <1424959177-28739-7-git-send-email-l.majewski@samsung.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020203.54EF29EA.003D,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 4 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1963 Lines: 49 On 02/26/2015 05:59 AM, Lukasz Majewski wrote: > The PWM FAN device can now be used as a thermal cooling device. Necessary > infrastructure has been added in this commit. > > Signed-off-by: Lukasz Majewski > Acked-by: Eduardo Valentin > --- > Changes for v2: > - Replace pwm_fan_cooling_states with pwm_fan_cooling_levels > - Update ctx->pwm_fan_state when correct data from device tree is available > - Using therma_cdev_update() when thermal is ready for controlling the fan > Changes for v3: > - Rename patch heading > - pwm_fan_of_get_cooling_data() now returns -EINVAL when no "cooling-levels" > property defined > - register of cooling device only when proper cooling data is present > Changes for v4: > - None > Changes for v5: > - Check for IS_ENABLED(CONFIG_THERMAL) has been added to prevent from > executing thermal_* specific functions > Changes for v6: > - Adding missing ctx == NULL check in pwm_fan_get_max_state() > - Call to thermal_cooling_device_unregister(ctx->cdev); at pwm_fan_remove() > - struct thermal_cooling_device *cdev; added to struct pwm_fan_ctx > --- > drivers/hwmon/pwm-fan.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 88 insertions(+), 1 deletion(-) [ ... ] > > @@ -200,6 +286,7 @@ static int pwm_fan_remove(struct platform_device *pdev) > { > struct pwm_fan_ctx *ctx = platform_get_drvdata(pdev); > > + thermal_cooling_device_unregister(ctx->cdev); Unfortunately there is still no prototype for this if CONFIG_THERMAL is not configured. Two options: Yet another revision, or wait a week until the prototypes are (hopefully) available and submit a patch without the conditionals. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/