mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hoan Tran <hotran@apm.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <lenb@kernel.org>,
	Robert Moore <robert.moore@intel.com>,
	Prakash Prashanth <pprakash@codeaurora.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	lho@apm.com, Duc Dang <dhdang@apm.com>,
	devel@acpica.org, Hoan Tran <hotran@apm.com>
Subject: [PATCH] mailbox: PCC: Fix return value of pcc_mbox_request_channel()
Date: Fri, 14 Oct 2016 16:20:21 -0700	[thread overview]
Message-ID: <1476487221-20337-1-git-send-email-hotran@apm.com> (raw)

When CONFIG_PCC is disabled, pcc_mbox_request_channel() needs to
return ERR_PTR(-ENODEV), not a NULL pointer, as the callers of
this function use IS_ERR() to check for error code.

Signed-off-by: Duc Dang <dhdang@apm.com>
Signed-off-by: Hoan Tran <hotran@apm.com>
---
 include/acpi/pcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h
index 17a940a..8caa79c 100644
--- a/include/acpi/pcc.h
+++ b/include/acpi/pcc.h
@@ -21,7 +21,7 @@ extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 							 int subspace_id)
 {
-	return NULL;
+	return ERR_PTR(-ENODEV);
 }
 static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
 #endif
-- 
1.9.1

             reply	other threads:[~2016-10-14 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 23:20 Hoan Tran [this message]
2016-10-21 21:31 ` Rafael J. Wysocki

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=1476487221-20337-1-git-send-email-hotran@apm.com \
    --to=hotran@apm.com \
    --cc=devel@acpica.org \
    --cc=dhdang@apm.com \
    --cc=lenb@kernel.org \
    --cc=lho@apm.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pprakash@codeaurora.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@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

all inboxes | Powered by JetHome®