From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 88489C07E9D for ; Sat, 24 Sep 2022 03:55:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F14210E170; Sat, 24 Sep 2022 03:54:56 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71AC510E0FE; Sat, 24 Sep 2022 03:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663991689; x=1695527689; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=MLejNRe6zMqpKGJ1HjzGL/nNtl3nyWQq/JpH4j73Ht0=; b=XHuy999yjbakUh9558ZEO3EhAOruapzP4VIqRAjREUkXjhFPFfQDso7u rc7fcgsEqxKO062qNFMh4DbQynaiA0HNZC2zrQRCHj/vsNxFPyrKbSArW MuwUOUaPywiqtC1ORsT8raE4ema9oybUqddYejwRVaRrUvBMKKT4UswDD XNFbn3fbhO02CgvPKQC+TQFsIrEO8x5LYibDPbq3vgCP5Udg1iLyhaxYG wY4fmku/Fw9FGkiBn7PBt+9HF1Nzz65xb/Pe8dYKoWFJ+WN2NaE8ebUKP VLdYfKEVE6WTbDg/apQgAHsyRDrzfXBh+F+GfVxVYBQbNTPaVnZoYnRj8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="387031438" X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="387031438" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 20:54:48 -0700 X-IronPort-AV: E=Sophos;i="5.93,341,1654585200"; d="scan'208";a="688955996" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.252.138.221]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 20:54:48 -0700 Date: Fri, 23 Sep 2022 20:54:47 -0700 Message-ID: <87r1018m0o.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Badal Nilawar In-Reply-To: <20220923195643.2376927-2-badal.nilawar@intel.com> References: <20220923195643.2376927-1-badal.nilawar@intel.com> <20220923195643.2376927-2-badal.nilawar@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH 1/7] drm/i915/hwmon: Add HWMON infrastructure X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-hwmon@vger.kernel.org, andi.shyti@intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 23 Sep 2022 12:56:37 -0700, Badal Nilawar wrote: > Hi Badal, Let me add this comment on the latest version so we don't forget about it: > +void i915_hwmon_register(struct drm_i915_private *i915) > +{ > + struct device *dev = i915->drm.dev; > + struct i915_hwmon *hwmon; > + struct device *hwmon_dev; > + struct hwm_drvdata *ddat; > + > + /* hwmon is available only for dGfx */ > + if (!IS_DGFX(i915)) > + return; > + > + hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL); If we are using devm_kzalloc we might as well replace all the hwmon_device_register_with_info's (in Patch 1 and 7) with devm_hwmon_device_register_with_info and then i915_hwmon_unregister is just this: void i915_hwmon_unregister(struct drm_i915_private *i915) { fetch_and_zero(&i915->hwmon); } Even the above statement is probably not needed but might as well retain it for sanity. So this is a simple change. Thanks. -- Ashutosh