From patchwork Thu Apr 18 19:58:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10907933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 925DE161F for ; Thu, 18 Apr 2019 19:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 776CC28C0B for ; Thu, 18 Apr 2019 19:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AD7928C0E; Thu, 18 Apr 2019 19:59:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0037528C0B for ; Thu, 18 Apr 2019 19:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nQNiueqDL9NPNzU5OAJAyZLj41HqErp2po06qjR1vus=; b=OtKO83hnnFNj49Lk/Q4CJYDg6M 6KrFcZGvp/C5XtA56EXsLqpX+9oCwegyWR10XqdLmv9ExndII40v7sSyoRzEJNiEX99gQdn9bz7Ke M/TF0E24BxY4L/SQ6MY0BV7PPgi7D3x31uEFAeWE0RixcTKOGGcQLFwYZUN7/c3cgEOtY1VgV2NYx hNrK+pN14QLVXs/Leh1GIy6jiToUceI4xDbTFGFhcWAsJKnzbD/2Zlqc/AM7rF20/NVdVY6l4WYQD OeBif/cWxAzwDux8dGCNICn5rXqyfVimT5G/Y8hc84ffPcUP6QtPQiZoQH8VGBdZk6Zzz9QgQeq69 DY3q8s1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHDBe-0003WA-DR; Thu, 18 Apr 2019 19:59:10 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHDB1-0002gP-Pf for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 19:58:34 +0000 Received: by mail-pg1-x543.google.com with SMTP id p6so1657192pgh.9 for ; Thu, 18 Apr 2019 12:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Dg22N7ij5CbFARw1/POY95wKTQwDv4ke41HQVemNXb0=; b=isK713otpnbCLzfyYP0C/L3CQGDivEgxsaQsNLJKL0LOP5j2LZQ55TosA655bgf6PU zPg89A27hwGa2tIdK9OwiKC05C1xC51XZEam1A4CWPhzydraLi0oy7R1yAYwVqzKYBLl hLaQ+KR8diIcxJt/+4OLQvspgp0aOXuAFWIbBR8cjCWOSiOIz6iDE11+D06uATslKbDE 4WL8KelALI9n9BakzeTJDgKfyQ1NYPi8B9MpU6H4QiTjgMnOgWyQKLsXqAsbSrexWnek BNeGnr1KHohFWbxYeXBtt2I3g+L4ATaKgedtzqkI1bRRVrLqpGmuLyqJmUfZJDKE2XsD e9VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Dg22N7ij5CbFARw1/POY95wKTQwDv4ke41HQVemNXb0=; b=qVrLX0c3q42aEv8apFgjrA3c3DirFfSeKpN7WuMezQbnFtlLdcu8+FEm+svDQu3Ts3 mMyjSma/o4Di+Tohh9VOgVLcVoKtmcGwXXvdWl2RCIPX8kn6sCJpyJJSP0LlQQuEjRul +bYpvUgaUwi9tiOBXoEwYrdjbRcxwvki5txtYdEhjTrdBvJZiuKDQJhUaHBCG5Gp5bOY 3CkhTdwgS6JFFx9R6C3bz7wh4OTvnmEEusLTpQBhBImjZ+2HNIeQwpSdHkhEnh3A10UJ KIZ5IMRvAIkY9meHHE5ANWUeptS7uwC2NSiJQiHLf8anneFSvQOZ1W5TuGiVhDQ3RtVe c8Mw== X-Gm-Message-State: APjAAAUkYuvNJpe4l96MgRk7mJAUD5+c2ihP3R5KnI/XCFdPw3IvLyMK i2nlhi3xzYpVTiD2MgOaw1k= X-Google-Smtp-Source: APXvYqzdpywDRRWK/t1CrguxPsh3QuvMjM/1PBlC1eJQcZ9pAW6iwz4VRB6e4iZFShYWRIg6RJRx1w== X-Received: by 2002:aa7:9a89:: with SMTP id w9mr90410001pfi.213.1555617510960; Thu, 18 Apr 2019 12:58:30 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 128sm3058432pgb.47.2019.04.18.12.58.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 12:58:30 -0700 (PDT) From: Guenter Roeck To: linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, linux-pm@vger.kernel.org Subject: [PATCH 5/6] hwmon: (npcm750-pwm-fan) Use devm_thermal_of_cooling_device_register Date: Thu, 18 Apr 2019 12:58:19 -0700 Message-Id: <1555617500-10862-6-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555617500-10862-1-git-send-email-linux@roeck-us.net> References: <1555617500-10862-1-git-send-email-linux@roeck-us.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_125832_275661_84C63762 X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean Delvare , Tomer Maimon , Nancy Yuen , Andrew Jeffery , Patrick Venture , Bartlomiej Zolnierkiewicz , Kamil Debski , Tali Perry , Eduardo Valentin , Avi Fishman , Joel Stanley , Daniel Lezcano , Zhang Rui , Guenter Roeck , Benjamin Fair MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 device removal. Fixes: f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver") Cc: Tomer Maimon Signed-off-by: Guenter Roeck --- drivers/hwmon/npcm750-pwm-fan.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c index b3b907bdfb63..f24cc00caba9 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c @@ -864,10 +864,8 @@ static int npcm7xx_create_pwm_cooling(struct device *dev, snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child, pwm_port); - cdev->tcdev = thermal_of_cooling_device_register(child, - cdev->name, - cdev, - &npcm7xx_pwm_cool_ops); + cdev->tcdev = devm_thermal_of_cooling_device_register(dev, child, + cdev->name, cdev, &npcm7xx_pwm_cool_ops); if (IS_ERR(cdev->tcdev)) return PTR_ERR(cdev->tcdev);