Skip to content

Commit 6a2c123

Browse files
Ming Leigregkh
authored andcommitted
firmware loader: fix another compile warning with PM_SLEEP unset
This patch fixes another compiling warning with PM_SLEEP unset: drivers/base/firmware_class.c:221:29: warning: 'fw_lookup_buf' defined but not used [-Wunused-function] This time I do build kernel with both PM_SLEEP set and unset, and no warning found any more with the patch. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4bb1667 commit 6a2c123

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎drivers/base/firmware_class.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,18 +218,6 @@ static int fw_lookup_and_allocate_buf(const char *fw_name,
218218
return tmp ? 0 : -ENOMEM;
219219
}
220220

221-
static struct firmware_buf *fw_lookup_buf(const char *fw_name)
222-
{
223-
struct firmware_buf *tmp;
224-
struct firmware_cache *fwc = &fw_cache;
225-
226-
spin_lock(&fwc->lock);
227-
tmp = __fw_lookup_buf(fw_name);
228-
spin_unlock(&fwc->lock);
229-
230-
return tmp;
231-
}
232-
233221
static void __fw_free_buf(struct kref *ref)
234222
{
235223
struct firmware_buf *buf = to_fwbuf(ref);
@@ -1280,6 +1268,18 @@ static int cache_firmware(const char *fw_name)
12801268
return ret;
12811269
}
12821270

1271+
static struct firmware_buf *fw_lookup_buf(const char *fw_name)
1272+
{
1273+
struct firmware_buf *tmp;
1274+
struct firmware_cache *fwc = &fw_cache;
1275+
1276+
spin_lock(&fwc->lock);
1277+
tmp = __fw_lookup_buf(fw_name);
1278+
spin_unlock(&fwc->lock);
1279+
1280+
return tmp;
1281+
}
1282+
12831283
/**
12841284
* uncache_firmware - remove one cached firmware image
12851285
* @fw_name: the firmware image name

0 commit comments

Comments
 (0)