summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2012-11-06 22:52:39 +0100
committerFelipe Balbi <balbi@ti.com>2012-11-08 16:04:04 +0200
commitfea20dbcfd6673d73d510984589897bd921c8a1d (patch)
treeba65cac9f5a3664afc74452f6105760970af15a6
parent8575f7a70610c89135c374e4305421c41e39e810 (diff)
downloadlinux-stable-fea20dbcfd6673d73d510984589897bd921c8a1d.tar.gz
linux-stable-fea20dbcfd6673d73d510984589897bd921c8a1d.tar.bz2
linux-stable-fea20dbcfd6673d73d510984589897bd921c8a1d.zip
usb: gadget: storage_common: Make fsg_lun_is_open() a function.
Since function-line macros are to be avoided, this commit replaces the fsg_lun_is_open() macro with a static inline function. While at it, this commit also adds “inline” modifier to the fsg_lun_from_dev() function. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/storage_common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
index 1b5bc6969a0a..0e3ae43454a2 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -155,9 +155,12 @@ struct fsg_lun {
struct device dev;
};
-#define fsg_lun_is_open(curlun) ((curlun)->filp != NULL)
+static inline bool fsg_lun_is_open(struct fsg_lun *curlun)
+{
+ return curlun->filp != NULL;
+}
-static struct fsg_lun *fsg_lun_from_dev(struct device *dev)
+static inline struct fsg_lun *fsg_lun_from_dev(struct device *dev)
{
return container_of(dev, struct fsg_lun, dev);
}