linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM <linux-pm@vger.kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Zhang Rui <rui.zhang@intel.com>
Subject: Re: [PATCH v2] thermal: Fail object registration if thermal class is not registered
Date: Tue, 24 Jan 2023 18:04:16 +0100	[thread overview]
Message-ID: <Y9APkJ8TfGu36iug@kroah.com> (raw)
In-Reply-To: <5660360.DvuYhMxLoT@kreacher>

On Mon, Jan 23, 2023 at 09:44:03PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> If thermal_class is not registered with the driver core, there is no way
> to expose the interfaces used by the thermal control framework, so
> prevent thermal zones and cooling devices from being registered in
> that case by returning an error from object registration functions.
> 
> For this purpose, use a thermal_class pointer that will be NULL if the
> class is not registered.  To avoid wasting memory in that case, allocate
> the thermal class object dynamically and if it fails to register, free
> it and clear the thermal_class pointer to NULL.
> 
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> 
> -> v2: This replaces the series at
>        https://lore.kernel.org/linux-pm/5905717.lOV4Wx5bFT@kreacher/

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

      parent reply	other threads:[~2023-01-24 17:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23 20:44 [PATCH v2] thermal: Fail object registration if thermal class is not registered Rafael J. Wysocki
2023-01-23 22:56 ` Daniel Lezcano
2023-01-24  6:31 ` Zhang, Rui
2023-01-24 17:04 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9APkJ8TfGu36iug@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).