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
Kirill Smelkov
linux
Commits
bde355c9
Commit
bde355c9
authored
Jun 02, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/mochel/linux-2.6-core
into kroah.com:/home/greg/linux/BK/driver-2.6
parents
727a7f73
a4e2bce3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
27 deletions
+29
-27
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_sysfs.c
+2
-2
include/linux/device.h
include/linux/device.h
+6
-25
include/linux/sysfs.h
include/linux/sysfs.h
+21
-0
No files found.
drivers/scsi/scsi_sysfs.c
View file @
bde355c9
...
...
@@ -320,7 +320,7 @@ sdev_store_timeout (struct device *dev, const char *buf, size_t count)
sdev
->
timeout
=
timeout
*
HZ
;
return
count
;
}
static
DEVICE_ATTR
(
timeout
,
S_IRUGO
|
S_IWUSR
,
sdev_show_timeout
,
sdev_store_timeout
)
static
DEVICE_ATTR
(
timeout
,
S_IRUGO
|
S_IWUSR
,
sdev_show_timeout
,
sdev_store_timeout
)
;
static
ssize_t
store_rescan_field
(
struct
device
*
dev
,
const
char
*
buf
,
size_t
count
)
...
...
@@ -328,7 +328,7 @@ store_rescan_field (struct device *dev, const char *buf, size_t count)
scsi_rescan_device
(
dev
);
return
count
;
}
static
DEVICE_ATTR
(
rescan
,
S_IWUSR
,
NULL
,
store_rescan_field
)
static
DEVICE_ATTR
(
rescan
,
S_IWUSR
,
NULL
,
store_rescan_field
)
;
static
ssize_t
sdev_store_delete
(
struct
device
*
dev
,
const
char
*
buf
,
size_t
count
)
...
...
include/linux/device.h
View file @
bde355c9
...
...
@@ -90,11 +90,7 @@ struct bus_attribute {
};
#define BUS_ATTR(_name,_mode,_show,_store) \
struct bus_attribute bus_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
extern
int
bus_create_file
(
struct
bus_type
*
,
struct
bus_attribute
*
);
extern
void
bus_remove_file
(
struct
bus_type
*
,
struct
bus_attribute
*
);
...
...
@@ -131,11 +127,7 @@ struct driver_attribute {
};
#define DRIVER_ATTR(_name,_mode,_show,_store) \
struct driver_attribute driver_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
extern
int
driver_create_file
(
struct
device_driver
*
,
struct
driver_attribute
*
);
extern
void
driver_remove_file
(
struct
device_driver
*
,
struct
driver_attribute
*
);
...
...
@@ -172,11 +164,7 @@ struct class_attribute {
};
#define CLASS_ATTR(_name,_mode,_show,_store) \
struct class_attribute class_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store)
extern
int
class_create_file
(
struct
class
*
,
const
struct
class_attribute
*
);
extern
void
class_remove_file
(
struct
class
*
,
const
struct
class_attribute
*
);
...
...
@@ -224,11 +212,8 @@ struct class_device_attribute {
};
#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store) \
struct class_device_attribute class_device_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
struct class_device_attribute class_device_attr_##_name = \
__ATTR(_name,_mode,_show,_store)
extern
int
class_device_create_file
(
struct
class_device
*
,
const
struct
class_device_attribute
*
);
...
...
@@ -342,11 +327,7 @@ struct device_attribute {
};
#define DEVICE_ATTR(_name,_mode,_show,_store) \
struct device_attribute dev_attr_##_name = { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
};
struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
extern
int
device_create_file
(
struct
device
*
device
,
struct
device_attribute
*
entry
);
...
...
include/linux/sysfs.h
View file @
bde355c9
...
...
@@ -24,6 +24,27 @@ struct attribute_group {
};
/**
* Use these macros to make defining attributes easier. See include/linux/device.h
* for examples..
*/
#define __ATTR(_name,_mode,_show,_store) { \
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
.show = _show, \
.store = _store, \
}
#define __ATTR_RO(_name) { \
.attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \
.show = _name##_show, \
}
#define __ATTR_NULL { .attr = { .name = NULL } }
struct
bin_attribute
{
struct
attribute
attr
;
size_t
size
;
...
...
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