Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1015002yba; Thu, 18 Apr 2019 13:38:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxESOEs9dTndVzS3JMSuCeR/oYPPvbmxBF7Sr/cAMmXZ6n8UAfh6x0z0hSSBlo3A/Tq45T X-Received: by 2002:a65:4185:: with SMTP id a5mr88777090pgq.82.1555619893610; Thu, 18 Apr 2019 13:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555619893; cv=none; d=google.com; s=arc-20160816; b=F/i9eXA7t8gl/cLhelzyXAPCx6vBmajr2K8kKSs3B31LU3yKnnOOJvy2f2w7/YHDAH ecCJQCY/3NXiUE8lCxmEgcoF/1Cdymx6uiGWpKTrRj2IsuQnCRqF0ipBsERSBWMVgCjp 6XGzQuDamD6hGHZFblhtb90c+YxJqeftQbCTn90pUfbF9tqpCymqvmBMy+MqTlo9UYHo GF+qtT5hHvA7NP3b8oywwHAd90mPu+nVJgae3o5EtSxRzHnQMtL4DvKt3n6qxg0Liv+Z fTakXyHtD/tQn+f6vcWNpPp7pZB8ujjolem0QB1WmlEoCo1UGFoeUczRe4lGTlK/Z8uJ HCPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BbxZ1Wm3vrcS9rLeR0qxSNVZn0SFBfcNjWi2YkD4UlA=; b=HWafrgXj0wuA/WjvWbiO9gud/+XJ6w5EeDmZfMKd8tW8cJUO+DJ0avQr97ZD/4FaLn Ela8oxQzqcCs6gB+NPsPkTlaVAe4j/gkKKKcu+rRdWWFuEKBkVg6wznj8Tb1sG9o/3dR StJMT//7drUBhk+gQG1tWTKSRp+Om6884cA4MMyAcA9F8X4RE+pDCl1YomKXs8fCnlPP J4dWQz+p5VomT5KkUGp4CqUukV/soD0zooMV5gnnnBL5UL2dNedyF4YiVUWmB/GjSwrb 1n1KXj2TWoJs8H/Fujk8BS+duoqwGDG8jRC7mNbM/X66gkwQ94TVpRdgJtssnwz0F9Fd 1tkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MbH1S6za; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m86si3198347pfi.235.2019.04.18.13.37.57; Thu, 18 Apr 2019 13:38:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MbH1S6za; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389865AbfDRUfp (ORCPT + 99 others); Thu, 18 Apr 2019 16:35:45 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:32908 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729198AbfDRUfo (ORCPT ); Thu, 18 Apr 2019 16:35:44 -0400 Received: by mail-pf1-f194.google.com with SMTP id h5so1625975pfo.0 for ; Thu, 18 Apr 2019 13:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BbxZ1Wm3vrcS9rLeR0qxSNVZn0SFBfcNjWi2YkD4UlA=; b=MbH1S6za1ShbicEWvBz4SvdQrGZEtT2+ggWSg/UIQoXd/22DBvpUlLbUamWzGMGZU6 Xjy6X2VgGHPCwwlJJ+EFTgj9GA40yTdwhK6uQu3wplSyCVb0dODkl2COmAod+1kn5SZS p/PpQWsHKmzWdBJ2ZslhHdNHypKgHSmfeAoy+0I834YIQp/shyH/Nl8dr1ki2RSY8Xru uyUhs9QQWCOL24hZZmOpYfBaf+uTUcEMxUu0syEHqk4R2wT4bM45VpFLC6wHvWqO1xfA lBOzlXU/V0l7DKbVEVopqf/4knCZz2FzM53ZoXkZgSghf2N6ByBfVLgeG1HZGROSw1Nb YYUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BbxZ1Wm3vrcS9rLeR0qxSNVZn0SFBfcNjWi2YkD4UlA=; b=lgrvq0fbihu0gdskmYKx+72N+MP/UfZKYoGBZN3WnktcYynwb4HoKa31inGV+/orfk s7+hACBxWeXul1EWiY95DDB6WNWT9j/qRyg0YqKwsY5JrTMG9bQCZRrtyy062Nas3N8b zgjg0SGTafZSeJj13rJwJrOWC7LBnjea6KuiqRfQxNPvzhB/7Fc3vvwsdG08aJP3bF7n AHuni84PzsvU0LRZj79E5pQlSCmk3gIbmcOcI3ccmpFaANkQvNFMVB+RHigcS4YnAREz 3A2A2eQKoWHuc6jqqr73u4J6BwRmbm4dobhHIuoVRMMrphiyD5TbkomYzhCDRpc5RwQs 2Dfw== X-Gm-Message-State: APjAAAV45dGhx99pGg2T8ZVs8p9mdR1y3GwU9509EHjtN3/RAPcYZM+u grR1cbrqxWD1ArAM4n8Xqov7U5IeaMkFKCid9g6AYQ== X-Received: by 2002:a63:e850:: with SMTP id a16mr86906748pgk.195.1555619742538; Thu, 18 Apr 2019 13:35:42 -0700 (PDT) MIME-Version: 1.0 References: <1555617500-10862-1-git-send-email-linux@roeck-us.net> <1555617500-10862-3-git-send-email-linux@roeck-us.net> In-Reply-To: <1555617500-10862-3-git-send-email-linux@roeck-us.net> From: Patrick Venture Date: Thu, 18 Apr 2019 13:35:31 -0700 Message-ID: Subject: Re: [PATCH 2/6] hwmon: (aspeed-pwm-tacho) Use devm_thermal_of_cooling_device_register To: Guenter Roeck Cc: linux-hwmon@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , linux-aspeed@lists.ozlabs.org, Linux Kernel Mailing List , OpenBMC Maillist , linux-pm@vger.kernel.org, Jean Delvare , Joel Stanley , Andrew Jeffery , Avi Fishman , Tomer Maimon , Tali Perry , Nancy Yuen , Benjamin Fair , Kamil Debski , Bartlomiej Zolnierkiewicz , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Mykola Kostenok Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 18, 2019 at 12:58 PM Guenter Roeck wrote: > > Use devm_thermal_of_cooling_device_register() to register the cooling > device. As a side effect, this fixes a driver bug: > thermal_cooling_device_unregister() was not called on removal. > > Fixes: f198907d2ff6d ("hwmon: (aspeed-pwm-tacho) cooling device support.") > Cc: Mykola Kostenok > Cc: Joel Stanley > Signed-off-by: Guenter Roeck Reviewed-by: Patrick Venture > --- > drivers/hwmon/aspeed-pwm-tacho.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c > index c4dd6301e7c8..0daf0b32aa4a 100644 > --- a/drivers/hwmon/aspeed-pwm-tacho.c > +++ b/drivers/hwmon/aspeed-pwm-tacho.c > @@ -830,10 +830,8 @@ static int aspeed_create_pwm_cooling(struct device *dev, > } > snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port); > > - cdev->tcdev = thermal_of_cooling_device_register(child, > - cdev->name, > - cdev, > - &aspeed_pwm_cool_ops); > + cdev->tcdev = devm_thermal_of_cooling_device_register(dev, child, > + cdev->name, cdev, &aspeed_pwm_cool_ops); > if (IS_ERR(cdev->tcdev)) > return PTR_ERR(cdev->tcdev); > > -- > 2.7.4 >