Commit 0538dcb0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

xen: xen-pciback: remove DRIVER_ATTR() usage

It's better to be explicit and use the DRIVER_ATTR_RW() and
DRIVER_ATTR_RO() macros when defining a driver's sysfs file.

Bonus is this fixes up a checkpatch.pl warning.

This is part of a series to drop DRIVER_ATTR() from the tree entirely.
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6a7a8176
...@@ -1172,7 +1172,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, ...@@ -1172,7 +1172,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func,
return err; return err;
} }
static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf, static ssize_t new_slot_store(struct device_driver *drv, const char *buf,
size_t count) size_t count)
{ {
int domain, bus, slot, func; int domain, bus, slot, func;
...@@ -1189,9 +1189,9 @@ static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf, ...@@ -1189,9 +1189,9 @@ static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
err = count; err = count;
return err; return err;
} }
static DRIVER_ATTR(new_slot, S_IWUSR, NULL, pcistub_slot_add); static DRIVER_ATTR_WO(new_slot);
static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf, static ssize_t remove_slot_store(struct device_driver *drv, const char *buf,
size_t count) size_t count)
{ {
int domain, bus, slot, func; int domain, bus, slot, func;
...@@ -1208,9 +1208,9 @@ static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf, ...@@ -1208,9 +1208,9 @@ static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf,
err = count; err = count;
return err; return err;
} }
static DRIVER_ATTR(remove_slot, S_IWUSR, NULL, pcistub_slot_remove); static DRIVER_ATTR_WO(remove_slot);
static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf) static ssize_t slots_show(struct device_driver *drv, char *buf)
{ {
struct pcistub_device_id *pci_dev_id; struct pcistub_device_id *pci_dev_id;
size_t count = 0; size_t count = 0;
...@@ -1231,9 +1231,9 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf) ...@@ -1231,9 +1231,9 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
return count; return count;
} }
static DRIVER_ATTR(slots, S_IRUSR, pcistub_slot_show, NULL); static DRIVER_ATTR_RO(slots);
static ssize_t pcistub_irq_handler_show(struct device_driver *drv, char *buf) static ssize_t irq_handlers_show(struct device_driver *drv, char *buf)
{ {
struct pcistub_device *psdev; struct pcistub_device *psdev;
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -1260,11 +1260,10 @@ static ssize_t pcistub_irq_handler_show(struct device_driver *drv, char *buf) ...@@ -1260,11 +1260,10 @@ static ssize_t pcistub_irq_handler_show(struct device_driver *drv, char *buf)
spin_unlock_irqrestore(&pcistub_devices_lock, flags); spin_unlock_irqrestore(&pcistub_devices_lock, flags);
return count; return count;
} }
static DRIVER_ATTR(irq_handlers, S_IRUSR, pcistub_irq_handler_show, NULL); static DRIVER_ATTR_RO(irq_handlers);
static ssize_t pcistub_irq_handler_switch(struct device_driver *drv, static ssize_t irq_handler_state_store(struct device_driver *drv,
const char *buf, const char *buf, size_t count)
size_t count)
{ {
struct pcistub_device *psdev; struct pcistub_device *psdev;
struct xen_pcibk_dev_data *dev_data; struct xen_pcibk_dev_data *dev_data;
...@@ -1301,10 +1300,9 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv, ...@@ -1301,10 +1300,9 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv,
err = count; err = count;
return err; return err;
} }
static DRIVER_ATTR(irq_handler_state, S_IWUSR, NULL, static DRIVER_ATTR_WO(irq_handler_state);
pcistub_irq_handler_switch);
static ssize_t pcistub_quirk_add(struct device_driver *drv, const char *buf, static ssize_t quirks_store(struct device_driver *drv, const char *buf,
size_t count) size_t count)
{ {
int domain, bus, slot, func, reg, size, mask; int domain, bus, slot, func, reg, size, mask;
...@@ -1323,7 +1321,7 @@ static ssize_t pcistub_quirk_add(struct device_driver *drv, const char *buf, ...@@ -1323,7 +1321,7 @@ static ssize_t pcistub_quirk_add(struct device_driver *drv, const char *buf,
return err; return err;
} }
static ssize_t pcistub_quirk_show(struct device_driver *drv, char *buf) static ssize_t quirks_show(struct device_driver *drv, char *buf)
{ {
int count = 0; int count = 0;
unsigned long flags; unsigned long flags;
...@@ -1366,10 +1364,9 @@ static ssize_t pcistub_quirk_show(struct device_driver *drv, char *buf) ...@@ -1366,10 +1364,9 @@ static ssize_t pcistub_quirk_show(struct device_driver *drv, char *buf)
return count; return count;
} }
static DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, static DRIVER_ATTR_RW(quirks);
pcistub_quirk_add);
static ssize_t permissive_add(struct device_driver *drv, const char *buf, static ssize_t permissive_store(struct device_driver *drv, const char *buf,
size_t count) size_t count)
{ {
int domain, bus, slot, func; int domain, bus, slot, func;
...@@ -1431,8 +1428,7 @@ static ssize_t permissive_show(struct device_driver *drv, char *buf) ...@@ -1431,8 +1428,7 @@ static ssize_t permissive_show(struct device_driver *drv, char *buf)
spin_unlock_irqrestore(&pcistub_devices_lock, flags); spin_unlock_irqrestore(&pcistub_devices_lock, flags);
return count; return count;
} }
static DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, static DRIVER_ATTR_RW(permissive);
permissive_add);
static void pcistub_exit(void) static void pcistub_exit(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment