From patchwork Thu Apr 18 19:58:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 10907899 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 4BEB5161F for ; Thu, 18 Apr 2019 19:58:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 301A828C08 for ; Thu, 18 Apr 2019 19:58:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23CE928C0B; Thu, 18 Apr 2019 19:58:35 +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 CB43B28C08 for ; Thu, 18 Apr 2019 19:58:34 +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: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:In-Reply-To: References:List-Owner; bh=TIdjgB8M+RuF6rdLUUedbw0aZDasjJ/14P9lo5nGS6k=; b=dVd CET5M8My4bjPTEUpAEvagD8E21q0Mj0gbirBmVXmp7452kfp4NhZIv+JUQM0AXVsF/BWW8pDooPpN oaAp9Nde5Mvf4BzNNOFF+YGcmbxp7ywBKaDPHx4ZtDTVxEuPA8lUV5olNdGW2rtMbzQPPrftgGseX PcQxgNSyaWWxcTrRI0DTrpfLJSnUTl5PAKfZ5g4DQlzZiEfaWzmGbMqF/1mvJSX/ekmASfoKzbZZx DgMENFaPFhzhVz0rm+dFjE76s8NdbMl1LmxHGo592nUIOSmbA+3ofw2ouNIjaAdwXB/zU9zd9q8Pb BcjHnuBlwjcNkrgoVREKadUPKs/1C3A==; 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 1hHDAy-0002c1-82; Thu, 18 Apr 2019 19:58:28 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHDAu-0002bE-Ib for linux-arm-kernel@lists.infradead.org; Thu, 18 Apr 2019 19:58:25 +0000 Received: by mail-pf1-x443.google.com with SMTP id z5so1582742pfn.3 for ; Thu, 18 Apr 2019 12:58:24 -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; bh=5vClmzB5ruRG5DfpQI3+/6Tcg0frA3QH3vJ0qCG0ZNU=; b=LIz5pkskdLDTvf/wpQtdZB/Rdb3xa6hScC/e0SIcu2CaAAmqoolajQgaIxB3XS92e8 ivmN4MYM6C6JpabkO9zXBwHUAl0bMfvZaTO0KI2ylmuV+yE8C09qbN6uQBtccQ2iUbEW 6gMp3VbJEjR0iCRLD3tsNHcPZ3UaDn6Dc4bZ2suoddCPXgNAvum5AC04rixylKsRX+Ct JimXJmeBemDobvjQo7ZeRetTLLKtLdqIRLc686g4ag58bNpSKMOWtBpc0oiYJDKzsTId IKU3mcxm1P9YugE5CL889/DQJrZcO0N3ZHS7XIiwwJY1Llhr5AZGAH6+zQCffXoEGSNI phLg== 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; bh=5vClmzB5ruRG5DfpQI3+/6Tcg0frA3QH3vJ0qCG0ZNU=; b=n+oM/HKIg9LZniIrxeIIFo4kDW8ArriSucVdbwFggSLi/Y7AHPEMQFTg6kmLl12+oS 1zr5mZuk3H6AGlEugj/FHfGKdYm25VdUhGy9AYMRtnwCHGPWU+xj2hnzIKrP/NxaoUXi w4cqVBnFq/t8IIMUmxX9aVr1X4EA3zgkII59gwnTJuUmHyUZTlcgjqtn4PM5i6NCf++7 VBfkrO5HrvOTju7yeqGfzlJcCO55zQ3cZdAj7XbsqRn/H75OUbnKGL7mrw5g5O41LCDu YAw1D2y3cOAOkZO1w2R6rp08Jp61pBfPKL/VvarCV6jrtLacgPPn7nSktQYa3uNci3kM Mztw== X-Gm-Message-State: APjAAAUl3aMPGCmWMBPXKuCWrd68ouC4RnD3JsNHFP8VojLVd+V25Xfk rVhsU106LO637Oi6Xc1bHlnjeab2AYo= X-Google-Smtp-Source: APXvYqz9KqL2njowruKOC8kSeVieLJgnycGmub6FNz59l+ivj2LAy9fGa31n4qrBCOJcJJmyVt89KA== X-Received: by 2002:a62:565c:: with SMTP id k89mr97032823pfb.175.1555617503748; Thu, 18 Apr 2019 12:58:23 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id p66sm5820800pfb.4.2019.04.18.12.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 12:58:22 -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 0/6] thermal: Introduce devm_thermal_of_cooling_device_register Date: Thu, 18 Apr 2019 12:58:14 -0700 Message-Id: <1555617500-10862-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190418_125824_639636_4907E98A X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. 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 thermal_of_cooling_device_register() and thermal_cooling_device_register() are typically called from driver probe functions, and thermal_cooling_device_unregister() is called from remove functions. This makes both a perfect candidate for device managed functions. Introduce devm_thermal_of_cooling_device_register(). This function can also be used to replace thermal_cooling_device_register() by passing a NULL pointer as device node. The new function requires both struct device * and struct device_node * as parameters since the struct device_node * parameter is not always identical to dev->of_node. Don't introduce a device managed remove function since it is not needed at this point. The patch series introduces the new function and then converts various hwmon drivers to use it.