Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp982912yba; Thu, 18 Apr 2019 13:00:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqi+U4cYHmIZ5hZWjhC0UpsuqNRojLrId4FZFzgmvUi8MPsnbGCHyWHHOGvEIaKSJPXJlc X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr8014227plg.321.1555617642928; Thu, 18 Apr 2019 13:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555617642; cv=none; d=google.com; s=arc-20160816; b=HGuKleJsiyxIVbTnC4E/pztNk9yazRf/NOgmRniZHkpnwe0izRCeM2plGhyLmQuQPU 1NtakK/6gvrt6ig/eQ8TCz12cL3otFy3VV4j746IuoFO6XjVoraN04Sy6jeBazVjWdbS UcERgkZtMHFP1aR5AHpie3sSp0ZyJyEB53znRhRySWu1Uzhb6ahWTpI8p++7hlWBYPBo t2abuKRsH52QLUHannoq5k3rn1K9deemRWg7fx5/6MHHnlOQLt5itjt9qpLPSh8qOq1T Kt3cIkIF2rUeBzSCdlQbpxQq6m/zdAnOValg9pFLePGyPejFaV4KEoNGV0A4qTN8oQVN 79bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=Dg22N7ij5CbFARw1/POY95wKTQwDv4ke41HQVemNXb0=; b=LC7gWzqGjE0Q7LVh9MPmEMxDP6xm/ILWEw6jQ7TFS5mNf/XuVX+jsaVyuyM64ZNVMj lok7H9ja3we3RHh8OKTC9ve0Nv4hvPoZKbZQyBRWDs4yFv9Q0yy6ZoUddiEXOZ4ghmFl c9Gl3Q+LfOEteToNuI9HiPOWYe9fwZo00ksPdU0xX6x3wKZBxZWQhhCsnn7TQI0fNK2f gzHw2eTqpttFq3F9t1F+jgAOX9rSLY57BWjakQFkPSVRtZaqlUz8niu+VPqNYc32SoQg 8tZbYQZIlNVanmR6Ey4VCygZmyLIFhqww8hEnalKEwNoKtbhKV9Fd5Z+hhnrY01JlXpj m0Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=isK713ot; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o8si2886041pll.391.2019.04.18.13.00.27; Thu, 18 Apr 2019 13:00:42 -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=fail header.i=@gmail.com header.s=20161025 header.b=isK713ot; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390252AbfDRT6t (ORCPT + 99 others); Thu, 18 Apr 2019 15:58:49 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39474 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390190AbfDRT6c (ORCPT ); Thu, 18 Apr 2019 15:58:32 -0400 Received: by mail-pg1-f194.google.com with SMTP id l18so1530639pgj.6; 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=fiNB8GIVV0+iAFofKpzqgfNVLFSom3owfQQS4QcflJrXdjmTddzHWCW9BzbXesg5Ag nu+CtKppYL1ev7TxZBy1Y+xy6aJYs3PbcC1DeZlaZtp38q79iL5DhOOCoJ087V9sXjuL a5xbupuLvMoY5wHKK70udwllaoWPb3ncqCZ+oA2rezfDZYDLASeEENTNGncKiVnlr/JT VRLqsradtyoVd14hjtsbb70fIET+p6ZyCXmODCK8Ozu5eudAU/9agcAxzbpUjR6Tp3Ga rGwEw9tPYvNYXmiTQnlxfWL5QYKK3jU/ymzt/V53/jLtZ0/n6KSej/+QrIOLZegQBaD0 lvug== X-Gm-Message-State: APjAAAWCKt+tKPKvxn0mKHFnCcrxiHyUi7xRHRKA4/FwDNW4SZFYS5QW 9Ec9wuqNJk0Wh5B1rRNAnwbnKQ4BN+A= 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 Cc: Jean Delvare , Joel Stanley , Andrew Jeffery , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Kamil Debski , Bartlomiej Zolnierkiewicz , Zhang Rui , Eduardo Valentin , Daniel Lezcano , Guenter Roeck 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4