linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: gregkh@linuxfoundation.org, ming.lei@canonical.com
Cc: jwboyer@fedoraproject.org, johannes@sipsolutions.net,
	luto@amacapital.net, corbet@lwn.net, dwmw2@infradead.org,
	dhowells@redhat.com, seth.forshee@canonical.com,
	rusty@rustcorp.com.au, mmarek@suse.cz, mjg59@srcf.ucam.org,
	kyle@kernel.org, zohar@linux.vnet.ibm.com,
	dmitry.kasatkin@gmail.com, vgoyal@redhat.com,
	computersforpeace@gmail.com, keescook@chromium.org,
	shuahkh@osg.samsung.com, torvalds@linux-foundation.org,
	linux-security-module@vger.kernel.org, keyrings@linux-nfs.org,
	linux-kernel@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@suse.com>
Subject: [PATCH v3 2/5] firmware: move completing fw into a helper
Date: Wed, 23 Dec 2015 13:34:54 -0800	[thread overview]
Message-ID: <1450906497-24179-3-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1450906497-24179-1-git-send-email-mcgrof@do-not-panic.com>

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This will be re-used later through a new extensible interface.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 drivers/base/firmware_class.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 6f5fcda71a60..d8148aa89b01 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -322,6 +322,15 @@ fail:
 	return rc;
 }
 
+static void fw_finish_direct_load(struct device *device,
+				  struct firmware_buf *buf)
+{
+	mutex_lock(&fw_lock);
+	set_bit(FW_STATUS_DONE, &buf->status);
+	complete_all(&buf->completion);
+	mutex_unlock(&fw_lock);
+}
+
 static int fw_get_filesystem_firmware(struct device *device,
 				       struct firmware_buf *buf)
 {
@@ -363,10 +372,7 @@ static int fw_get_filesystem_firmware(struct device *device,
 	if (!rc) {
 		dev_dbg(device, "system data: direct-loading firmware %s\n",
 			buf->fw_id);
-		mutex_lock(&fw_lock);
-		set_bit(FW_STATUS_DONE, &buf->status);
-		complete_all(&buf->completion);
-		mutex_unlock(&fw_lock);
+		fw_finish_direct_load(device, buf);
 	}
 
 	return rc;
-- 
2.6.2


  parent reply	other threads:[~2015-12-23 21:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23 21:34 [PATCH v3 0/5] firmware_class: extensible firmware API Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 1/5] firmware: generalize "firmware" as "system data" helpers Luis R. Rodriguez
2016-01-04 20:41   ` Kees Cook
2016-01-22 20:10     ` Luis R. Rodriguez
2015-12-23 21:34 ` Luis R. Rodriguez [this message]
2016-01-04 20:44   ` [PATCH v3 2/5] firmware: move completing fw into a helper Josh Boyer
2015-12-23 21:34 ` [PATCH v3 3/5] firmware: fold successful fw read early Luis R. Rodriguez
2016-01-04 20:48   ` Josh Boyer
2016-01-22  1:45     ` Luis R. Rodriguez
2016-01-22 11:56       ` Mimi Zohar
2016-01-22 19:50         ` Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 4/5] firmware: generalize reading file contents as a helper Luis R. Rodriguez
2016-01-22  1:43   ` Luis R. Rodriguez
2015-12-23 21:34 ` [PATCH v3 5/5] firmware: add an extensible system data helpers Luis R. Rodriguez
2015-12-23 22:26   ` kbuild test robot
2016-01-22  1:27     ` Luis R. Rodriguez
2016-01-04 20:31   ` Kees Cook
2016-01-22  1:58     ` Luis R. Rodriguez

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=1450906497-24179-3-git-send-email-mcgrof@do-not-panic.com \
    --to=mcgrof@do-not-panic.com \
    --cc=computersforpeace@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=jwboyer@fedoraproject.org \
    --cc=keescook@chromium.org \
    --cc=keyrings@linux-nfs.org \
    --cc=kyle@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mcgrof@suse.com \
    --cc=ming.lei@canonical.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=mmarek@suse.cz \
    --cc=rusty@rustcorp.com.au \
    --cc=seth.forshee@canonical.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vgoyal@redhat.com \
    --cc=zohar@linux.vnet.ibm.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).