From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Greg KH <greg@kroah.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
"Darrick J. Wong" <djwong@us.ibm.com>,
linux-next@vger.kernel.org, scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH] firmware: provide stubs for the FW_LOADER=n case
Date: Fri, 07 Mar 2008 08:57:54 -0600 [thread overview]
Message-ID: <1204901874.2889.3.camel@localhost.localdomain> (raw)
In-Reply-To: <20080307045413.GB913@kroah.com>
libsas has a case where it uses the firmware loader to provide services,
but doesn't want to select it all the time. This currently causes a
compile failure in libsas if FW_LOADER=n. Fix this by providing error
stubs for the firmware loader API in the FW_LOADER=n case.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
On Thu, 2008-03-06 at 20:54 -0800, Greg KH wrote:
> Yes, this is what I was thinking was needed.
>
> Care to resend it with a signed-off-by?
>
> thanks,
Sure, attached.
James
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 33d8f20..4d10c73 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -10,7 +10,10 @@ struct firmware {
size_t size;
u8 *data;
};
+
struct device;
+
+#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
int request_firmware(const struct firmware **fw, const char *name,
struct device *device);
int request_firmware_nowait(
@@ -19,4 +22,24 @@ int request_firmware_nowait(
void (*cont)(const struct firmware *fw, void *context));
void release_firmware(const struct firmware *fw);
+#else
+static inline int request_firmware(const struct firmware **fw,
+ const char *name,
+ struct device *device)
+{
+ return -EINVAL;
+}
+static inline int request_firmware_nowait(
+ struct module *module, int uevent,
+ const char *name, struct device *device, void *context,
+ void (*cont)(const struct firmware *fw, void *context))
+{
+ return -EINVAL;
+}
+
+static inline void release_firmware(const struct firmware *fw)
+{
+}
+#endif
+
#endif
next prev parent reply other threads:[~2008-03-07 14:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 17:09 next-2008-0306 scsi/libsas build failure Randy Dunlap
2008-03-06 18:16 ` Greg KH
2008-03-06 18:22 ` Randy Dunlap
2008-03-06 21:01 ` Darrick J. Wong
2008-03-06 21:02 ` [PATCH] libsas: Check that the firmware loader is present in sas_request_addr Darrick J. Wong
2008-03-06 21:17 ` James Bottomley
2008-03-06 21:20 ` Randy Dunlap
2008-03-06 22:04 ` Randy Dunlap
2008-03-06 22:16 ` James Bottomley
2008-03-07 4:54 ` Greg KH
2008-03-07 14:57 ` James Bottomley [this message]
2008-03-07 17:08 ` patch firmware-provide-stubs-for-the-fw_loader-n-case.patch added to gregkh-2.6 tree gregkh
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=1204901874.2889.3.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=djwong@us.ibm.com \
--cc=greg@kroah.com \
--cc=linux-next@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=randy.dunlap@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.