Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp982169yba; Thu, 18 Apr 2019 12:59:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNwAJ8wwwgkWKeeUr/hUGoQ7KNXbdfNreoi9BCqLUjuyApg+qhQM/eiyo+m9DGnzNrEHop X-Received: by 2002:a17:902:6b8b:: with SMTP id p11mr73410917plk.225.1555617596385; Thu, 18 Apr 2019 12:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555617596; cv=none; d=google.com; s=arc-20160816; b=LwtW8ChruF/cOM4fGVwVDi2cmCl0PvHZDX2d9YmvxXsekgtKv5IGkDBEYV62Myud4r TI3RkI/aPXNDDvchGwH1MTC1mrFUphoGhOvsb0vxigN6mdN260iKv67l0j4NN7GpYfNQ 4GoNoKIjAbSRZgiKPcNth0fsspIp7AGCsHdglnpbj/42tsEdLCEmDucLZl1YKL40m6xx KOLdJW5rWpt9QG52nEjaIySZfBUY+BiJ96Ug8PC3ySlg19lk5PoZc6niFevm4f+iXPgM 8vUU7Zgwr1pKwWwuOUzSwnv9moEYryqE5jSIvWe9QEY34C+BpSqLVQNU/VvA3BEAsnLH fLKg== 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=P2kSmkr0gjxDrzltwWGdPiHLXWPJpXIu1nScfCyroiQ=; b=FmxFY5yg/cFVdxdEJScaIB9QYT9MthtqLfBczQmbN47voRVXWy6Uc7C/xSCop403VP eMIurXXtHKlQvqy7/a++DkE3C9fgw3/YhHl0Ywx9h/r/kGoEd4pm8QNsoUx+BdBW/jzb InhBPrXqhhUbbcki9vMfglsikRAFbZFduByljyTBn//xSGL0kcy8BH3+jl0YRQWvIvRX VpoVhAM11ALPcsT3TWzYoMZ68CT/dQqkly70tU8Wf/JEnaqNXfCaZY6uTEMPWJQPo0Cj pb9I9fJk2h3f+xHlM25pBVJV4aQDaxM0c8Oxd/1AzhfovvKKw+z4zb65fu5FrChhdr/7 JEvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aw4PbPE2; 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 m72si3235642pfj.279.2019.04.18.12.59.41; Thu, 18 Apr 2019 12:59:56 -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=aw4PbPE2; 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 S2390178AbfDRT63 (ORCPT + 99 others); Thu, 18 Apr 2019 15:58:29 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:34177 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731317AbfDRT61 (ORCPT ); Thu, 18 Apr 2019 15:58:27 -0400 Received: by mail-pg1-f194.google.com with SMTP id v12so1679653pgq.1; Thu, 18 Apr 2019 12:58:27 -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=P2kSmkr0gjxDrzltwWGdPiHLXWPJpXIu1nScfCyroiQ=; b=aw4PbPE2LbcT7H4oTgNGIFAcjm+SZXbSWJcBJtNUrPH25VznEczbSeJ40NXsVwaMtx h6y3WWQzakymz1v9uoaJ+dbywvlrNiry1RccU8/skfi5CL4Vz3CaOoWOE7pyFskOJGme VOf9/JgETdp70sq0dVR6mv7ot3zZY+pKRTRtUFmhdr788n34/Y4G8wJOUVbmdktSV6iW TYcmy2Ow0VuVtGlgxYZirN62xuRxV2sICTJkCbsH+jBd8LPZCHBhL3IHbvEQpMmyqzxD oc3O2D6vdravLNIs9ZNnsLCcF+nTexby1/A5gq3A98N7xUJc7jnTPlE0yLXXNBBiK0l9 HYaA== 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=P2kSmkr0gjxDrzltwWGdPiHLXWPJpXIu1nScfCyroiQ=; b=gLxdNcmpQcGaGb3+JdmoWT708cOJ9unGDHt4W86kZPZUtT7yoPnNouePSa/BVVG3Ex fxi0+ScsIbyJZF7ChFlNuYlfowSSWqbAyXw9dycyf3ysMbszm3CaV4ghbVCiued6qqqR l0XNXrdoMv3mrRmDYrbMwB3/vZx8jOUFfZFFLNgNiaREEElU9BFBHGKH1Xsw3nZsc8N6 gRYi+MU7tTYeRG/JrlvpEQsyuWWc0yZJnHs9Zg4zjUAWLe2R3lieOa+7xa3VcFGGwfO7 mZqCW76KvxtCzeSrRkl6BxEnG0844qQBaFPzSQybMpWZKMx9q+x/Oj19HXfpHTPP7JMI AkTg== X-Gm-Message-State: APjAAAV/xufX65STsQzX+ZFVr5FrFiGdoh7MZK28uDXteHWT5KdsCyHU vAVHBc+TBCrNdGO2SAPMKoc4KWGQyfw= X-Received: by 2002:a63:c61:: with SMTP id 33mr84153243pgm.293.1555617506752; Thu, 18 Apr 2019 12:58:26 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h10sm4335474pfj.79.2019.04.18.12.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 12:58:26 -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 , Mykola Kostenok Subject: [PATCH 2/6] hwmon: (aspeed-pwm-tacho) Use devm_thermal_of_cooling_device_register Date: Thu, 18 Apr 2019 12:58:16 -0700 Message-Id: <1555617500-10862-3-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 removal. Fixes: f198907d2ff6d ("hwmon: (aspeed-pwm-tacho) cooling device support.") Cc: Mykola Kostenok Cc: Joel Stanley Signed-off-by: Guenter Roeck --- 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