mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-05-02 18:17:50 -04:00
ACPI: Use DEVICE_ATTR_<RW|RO|WO> macros
Instead of open coding DEVICE_ATTR(), use the DEVICE_ATTR_RW(), DEVICE_ATTR_RO() and DEVICE_ATTR_WO() macros wherever possible. This required a few functions to be renamed but the functionality itself is unchanged. Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
19c329f680
commit
0f39ee8324
@@ -333,11 +333,11 @@ int acpi_device_modalias(struct device *dev, char *buf, int size)
|
||||
EXPORT_SYMBOL_GPL(acpi_device_modalias);
|
||||
|
||||
static ssize_t
|
||||
acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
return __acpi_device_modalias(to_acpi_device(dev), buf, 1024);
|
||||
}
|
||||
static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
|
||||
static DEVICE_ATTR_RO(modalias);
|
||||
|
||||
static ssize_t real_power_state_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
@@ -366,8 +366,8 @@ static ssize_t power_state_show(struct device *dev,
|
||||
static DEVICE_ATTR_RO(power_state);
|
||||
|
||||
static ssize_t
|
||||
acpi_eject_store(struct device *d, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
eject_store(struct device *d, struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct acpi_device *acpi_device = to_acpi_device(d);
|
||||
acpi_object_type not_used;
|
||||
@@ -395,28 +395,28 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
|
||||
return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN;
|
||||
}
|
||||
|
||||
static DEVICE_ATTR(eject, 0200, NULL, acpi_eject_store);
|
||||
static DEVICE_ATTR_WO(eject);
|
||||
|
||||
static ssize_t
|
||||
acpi_device_hid_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
hid_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
|
||||
return sprintf(buf, "%s\n", acpi_device_hid(acpi_dev));
|
||||
}
|
||||
static DEVICE_ATTR(hid, 0444, acpi_device_hid_show, NULL);
|
||||
static DEVICE_ATTR_RO(hid);
|
||||
|
||||
static ssize_t acpi_device_uid_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t uid_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
|
||||
return sprintf(buf, "%s\n", acpi_dev->pnp.unique_id);
|
||||
}
|
||||
static DEVICE_ATTR(uid, 0444, acpi_device_uid_show, NULL);
|
||||
static DEVICE_ATTR_RO(uid);
|
||||
|
||||
static ssize_t acpi_device_adr_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t adr_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
|
||||
@@ -425,16 +425,16 @@ static ssize_t acpi_device_adr_show(struct device *dev,
|
||||
else
|
||||
return sprintf(buf, "0x%08llx\n", acpi_dev->pnp.bus_address);
|
||||
}
|
||||
static DEVICE_ATTR(adr, 0444, acpi_device_adr_show, NULL);
|
||||
static DEVICE_ATTR_RO(adr);
|
||||
|
||||
static ssize_t acpi_device_path_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
static ssize_t path_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
|
||||
return acpi_object_path(acpi_dev->handle, buf);
|
||||
}
|
||||
static DEVICE_ATTR(path, 0444, acpi_device_path_show, NULL);
|
||||
static DEVICE_ATTR_RO(path);
|
||||
|
||||
/* sysfs file that shows description text from the ACPI _STR method */
|
||||
static ssize_t description_show(struct device *dev,
|
||||
@@ -463,8 +463,8 @@ static ssize_t description_show(struct device *dev,
|
||||
static DEVICE_ATTR_RO(description);
|
||||
|
||||
static ssize_t
|
||||
acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf) {
|
||||
sun_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf) {
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
acpi_status status;
|
||||
unsigned long long sun;
|
||||
@@ -475,11 +475,11 @@ acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
return sprintf(buf, "%llu\n", sun);
|
||||
}
|
||||
static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL);
|
||||
static DEVICE_ATTR_RO(sun);
|
||||
|
||||
static ssize_t
|
||||
acpi_device_hrv_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf) {
|
||||
hrv_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf) {
|
||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||
acpi_status status;
|
||||
unsigned long long hrv;
|
||||
@@ -490,7 +490,7 @@ acpi_device_hrv_show(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
return sprintf(buf, "%llu\n", hrv);
|
||||
}
|
||||
static DEVICE_ATTR(hrv, 0444, acpi_device_hrv_show, NULL);
|
||||
static DEVICE_ATTR_RO(hrv);
|
||||
|
||||
static ssize_t status_show(struct device *dev, struct device_attribute *attr,
|
||||
char *buf) {
|
||||
|
||||
Reference in New Issue
Block a user