Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399AbbBYPrf (ORCPT ); Wed, 25 Feb 2015 10:47:35 -0500 Received: from mga03.intel.com ([134.134.136.65]:3962 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752358AbbBYPrd convert rfc822-to-8bit (ORCPT ); Wed, 25 Feb 2015 10:47:33 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,645,1418112000"; d="scan'208";a="683274792" From: "Ong, Boon Leong" To: "Kweh, Hock Leong" CC: "linux-pm@vger.kernel.org" , LKML , "Bryan O'Donoghue" , "Ong, Boon Leong" , "Zhang, Rui" , "edubezval@gmail.com" Subject: RE: [PATCH] thermal: intel Quark SoC X1000 DTS thermal driver Thread-Topic: [PATCH] thermal: intel Quark SoC X1000 DTS thermal driver Thread-Index: AQHQRhthue+lW/FBiEKybiZlya5HaJzsNOnQgAAkD6CAESm0MIAEFEbg Date: Wed, 25 Feb 2015 15:47:16 +0000 Message-ID: References: <1423673509-11195-1-git-send-email-boon.leong.ong@intel.com> <1423673509-11195-2-git-send-email-boon.leong.ong@intel.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1701 Lines: 43 >-----Original Message----- >From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel- >owner@vger.kernel.org] On Behalf Of Ong, Boon Leong >Sent: Monday, February 23, 2015 9:39 AM >To: Kweh, Hock Leong; Zhang, Rui; edubezval@gmail.com >Cc: linux-pm@vger.kernel.org; LKML; Bryan O'Donoghue >Subject: RE: [PATCH] thermal: intel Quark SoC X1000 DTS thermal driver > >>> +static struct soc_sensor_entry *alloc_soc_dts(void) >>> +{ >>> + struct soc_sensor_entry *aux_entry; >>> + int err; >>> + u32 out; >>> + int wr_mask; >>> + >>> + aux_entry = kzalloc(sizeof(*aux_entry), GFP_KERNEL); >> >>Wondering is it possible to use the resource-managed functions (for e.g. >>devm_kzalloc())? This could help the driver looks more neat and clean >>where the resource-managed framework will help you take care all the >>kfree(). >> >>Understand that the flow here is to call the thermal_zone_device_register() >>function after this aux_entry allocation. >> >>But thinking would it also working if change the flow to call >>thermal_zone_device_register() function 1st to obtain the >>thermal_zone_device >>then later on perform devm_kzalloc() and assign it back to devdata. >> >Ok, it is worth exploring on this devm_kzalloc() for neatness. I give it a thought again and I think that devm_kzalloc() is only useful if the thermal driver is platform driver. So, for Quark thermal driver, this will not be useful. So, the existing kzalloc() method is sufficient. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/