From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: jikos@kernel.org
Cc: benjamin.tissoires@redhat.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org,
Arvind Yadav <arvind.yadav.cs@gmail.com>
Subject: [PATCH] hid-logitech : Dummy hid-lg functions should return proper error code
Date: Wed, 22 Jun 2016 01:08:59 +0530 [thread overview]
Message-ID: <1466537939-32299-1-git-send-email-arvind.yadav.cs@gmail.com> (raw)
inline lgff_init stub simply allows compilation on systems with
CONFIG_LOGITECH_FF disabled. The inline lgff_init should return
-ENODEV instead -1 to indicate lack of support when attempting to
register an lg_driver on such a system with CONFIG_LOGITECH_FF
disabled. Same for inline lg2ff_init and lg3ff_init stub when
CONFIG_LOGIRUMBLEPAD2_FF and CONFIG_LOGIG940_FF disabled.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/hid/hid-lg.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-lg.h b/drivers/hid/hid-lg.h
index 10dd8f0..88b8ebd 100644
--- a/drivers/hid/hid-lg.h
+++ b/drivers/hid/hid-lg.h
@@ -1,6 +1,8 @@
#ifndef __HID_LG_H
#define __HID_LG_H
+#include <linux/errno.h>
+
struct lg_drv_data {
unsigned long quirks;
void *device_props; /* Device specific properties */
@@ -9,19 +11,19 @@ struct lg_drv_data {
#ifdef CONFIG_LOGITECH_FF
int lgff_init(struct hid_device *hdev);
#else
-static inline int lgff_init(struct hid_device *hdev) { return -1; }
+static inline int lgff_init(struct hid_device *hdev) { return -ENODEV; }
#endif
#ifdef CONFIG_LOGIRUMBLEPAD2_FF
int lg2ff_init(struct hid_device *hdev);
#else
-static inline int lg2ff_init(struct hid_device *hdev) { return -1; }
+static inline int lg2ff_init(struct hid_device *hdev) { return -ENODEV; }
#endif
#ifdef CONFIG_LOGIG940_FF
int lg3ff_init(struct hid_device *hdev);
#else
-static inline int lg3ff_init(struct hid_device *hdev) { return -1; }
+static inline int lg3ff_init(struct hid_device *hdev) { return -ENODEV; }
#endif
#endif
--
1.9.1
reply other threads:[~2016-06-21 19:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1466537939-32299-1-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).