Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3b720944
Commit
3b720944
authored
Aug 18, 2009
by
Dmitry Torokhov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: psmouse - allow defining read-only attributes
Signed-off-by:
Dmitry Torokhov
<
dtor@mail.ru
>
parent
25a70e38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
drivers/input/mouse/psmouse.h
drivers/input/mouse/psmouse.h
+16
-5
No files found.
drivers/input/mouse/psmouse.h
View file @
3b720944
...
@@ -116,9 +116,7 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *at
...
@@ -116,9 +116,7 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *at
ssize_t
psmouse_attr_set_helper
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
ssize_t
psmouse_attr_set_helper
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
const
char
*
buf
,
size_t
count
);
const
char
*
buf
,
size_t
count
);
#define __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, _protect) \
#define __PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect) \
static ssize_t _show(struct psmouse *, void *data, char *); \
static ssize_t _set(struct psmouse *, void *data, const char *, size_t); \
static struct psmouse_attribute psmouse_attr_##_name = { \
static struct psmouse_attribute psmouse_attr_##_name = { \
.dattr = { \
.dattr = { \
.attr = { \
.attr = { \
...
@@ -134,7 +132,20 @@ static struct psmouse_attribute psmouse_attr_##_name = { \
...
@@ -134,7 +132,20 @@ static struct psmouse_attribute psmouse_attr_##_name = { \
.protect = _protect, \
.protect = _protect, \
}
}
#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
#define __PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, _protect) \
__PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, 1)
static ssize_t _show(struct psmouse *, void *, char *); \
static ssize_t _set(struct psmouse *, void *, const char *, size_t); \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, _set, _protect)
#define PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set) \
__PSMOUSE_DEFINE_ATTR(_name, _mode, _data, _show, _set, 1)
#define PSMOUSE_DEFINE_RO_ATTR(_name, _mode, _data, _show) \
static ssize_t _show(struct psmouse *, void *, char *); \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, _show, NULL, 1)
#define PSMOUSE_DEFINE_WO_ATTR(_name, _mode, _data, _set) \
static ssize_t _set(struct psmouse *, void *, const char *, size_t); \
__PSMOUSE_DEFINE_ATTR_VAR(_name, _mode, _data, NULL, _set, 1)
#endif
/* _PSMOUSE_H */
#endif
/* _PSMOUSE_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment