From patchwork Tue Aug 4 16:33:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 6942681 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BB3C9F358 for ; Tue, 4 Aug 2015 16:33:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4ECF0205AA for ; Tue, 4 Aug 2015 16:33:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BC8B20585 for ; Tue, 4 Aug 2015 16:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753789AbbHDQdp (ORCPT ); Tue, 4 Aug 2015 12:33:45 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:36685 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752998AbbHDQdo (ORCPT ); Tue, 4 Aug 2015 12:33:44 -0400 Received: by pdco4 with SMTP id o4so6427461pdc.3; Tue, 04 Aug 2015 09:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=LRetTf4HmEirvsTICJEezbawEcxnugFo2YT2I4vY35s=; b=h4/WdRV3Rlw+Q9W8lKvprVKQPUxysFkEg3xTUfD5B5er7HCfto2SANgWC0/K9AOzb5 A84G+bWmZQfIiSct/geTxuB7OeUVV3V1qhiOqhwOerJd2v47z6lxgD9gvlIknn/1O2uH 1kqmRTA5SJGeoLyKIURExlAneArkAo+Lb7ewFQbkkyttXUeAcEnbxG0ahg8G8QljqLDF sZH1RuPYeOGG2YcMLUIItt6+24vnbEbetKPUUlA8nNGl12WiXhfAmqBENncM5zg8ZyMi 9UqVSXD4IZUP1H/A2uVXuFPChO4icA0s5dWPikXT49nuL/3BmrKPBOagR0CZJBplU9I6 XXlw== X-Received: by 10.70.38.231 with SMTP id j7mr9707051pdk.146.1438706023982; Tue, 04 Aug 2015 09:33:43 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1301:fca4:4f94:5ef8:5889]) by smtp.gmail.com with ESMTPSA id pc9sm2019309pdb.6.2015.08.04.09.33.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 04 Aug 2015 09:33:42 -0700 (PDT) Date: Tue, 4 Aug 2015 09:33:40 -0700 From: Dmitry Torokhov To: Eduardo Valentin Cc: Zhang Rui , Javi Merino , Lukasz Majewski , Peter Feuerer , Sascha Hauer , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] thermal: power_allocator: do not use devm* interfaces Message-ID: <20150804163340.GA33245@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The code in question is called outside of standard driver probe()/remove() callbacks and thus will not benefit from use of devm* infrastructure. Signed-off-by: Dmitry Torokhov --- drivers/thermal/power_allocator.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/power_allocator.c b/drivers/thermal/power_allocator.c index 13ccf00..e9ba29f 100644 --- a/drivers/thermal/power_allocator.c +++ b/drivers/thermal/power_allocator.c @@ -334,7 +334,7 @@ static int allocate_power(struct thermal_zone_device *tz, max_allocatable_power, current_temp, control_temp - current_temp); - devm_kfree(&tz->device, req_power); + kfree(req_power); unlock: mutex_unlock(&tz->lock); @@ -426,7 +426,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz) return -EINVAL; } - params = devm_kzalloc(&tz->device, sizeof(*params), GFP_KERNEL); + params = kzalloc(sizeof(*params), GFP_KERNEL); if (!params) return -ENOMEM; @@ -468,14 +468,14 @@ static int power_allocator_bind(struct thermal_zone_device *tz) return 0; free: - devm_kfree(&tz->device, params); + kfree(params); return ret; } static void power_allocator_unbind(struct thermal_zone_device *tz) { dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id); - devm_kfree(&tz->device, tz->governor_data); + kfree(tz->governor_data); tz->governor_data = NULL; }