OSDN Git Service

PCI: sysfs: Change DEVICE_ATTR() to DEVICE_ATTR_WO()
authorKelsey Skunberg <skunberg.kelsey@gmail.com>
Thu, 15 Aug 2019 15:33:52 +0000 (09:33 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 20 Aug 2019 19:04:55 +0000 (14:04 -0500)
commit4e2b79436e4f22b225ee445832705bb7c4675807
treebb5ebf909baacdde828dda5250bf28704ac34792
parent8bdfa145f58220796abddc93b5038efa6e7e90fc
PCI: sysfs: Change DEVICE_ATTR() to DEVICE_ATTR_WO()

DEVICE_ATTR() should only be used when files have unusual permissions.
Change DEVICE_ATTR() with '0220' write-only permissions to
DEVICE_ATTR_WO(), e.g.,

  - static DEVICE_ATTR(_name, (S_IWUSR | S_IWGRP), NULL, _store);
  + static DEVICE_ATTR_WO(_name);

Since _store is no longer passed, make the _name passed by DEVICE_ATTR_WO()
and the related _name##_store() name match with each other, e.g.,

  DEVICE_ATTR_WO(bus_rescan) must be able to call bus_rescan_store()

Link: https://lore.kernel.org/r/20190815153352.86143-4-skunberg.kelsey@gmail.com
Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Donald Dutile <ddutile@redhat.com>
drivers/pci/pci-sysfs.c