diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-19 08:56:28 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2017-07-21 02:32:49 -0400 |
commit | 13efe1a05384bc405cac7187e02b547e5f40e614 (patch) | |
tree | ac93e548f060f77ae0e5ec96f4cbdf1c57d4d1fe | |
parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) |
dmaengine: ppc4xx: 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.
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/ppc4xx/adma.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index b1535b1fe95c..a241112508b4 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c | |||
@@ -4307,7 +4307,7 @@ static int ppc440spe_adma_remove(struct platform_device *ofdev) | |||
4307 | * "poly" allows setting/checking used polynomial (for PPC440SPe only). | 4307 | * "poly" allows setting/checking used polynomial (for PPC440SPe only). |
4308 | */ | 4308 | */ |
4309 | 4309 | ||
4310 | static ssize_t show_ppc440spe_devices(struct device_driver *dev, char *buf) | 4310 | static ssize_t devices_show(struct device_driver *dev, char *buf) |
4311 | { | 4311 | { |
4312 | ssize_t size = 0; | 4312 | ssize_t size = 0; |
4313 | int i; | 4313 | int i; |
@@ -4321,16 +4321,17 @@ static ssize_t show_ppc440spe_devices(struct device_driver *dev, char *buf) | |||
4321 | } | 4321 | } |
4322 | return size; | 4322 | return size; |
4323 | } | 4323 | } |
4324 | static DRIVER_ATTR_RO(devices); | ||
4324 | 4325 | ||
4325 | static ssize_t show_ppc440spe_r6enable(struct device_driver *dev, char *buf) | 4326 | static ssize_t enable_show(struct device_driver *dev, char *buf) |
4326 | { | 4327 | { |
4327 | return snprintf(buf, PAGE_SIZE, | 4328 | return snprintf(buf, PAGE_SIZE, |
4328 | "PPC440SP(e) RAID-6 capabilities are %sABLED.\n", | 4329 | "PPC440SP(e) RAID-6 capabilities are %sABLED.\n", |
4329 | ppc440spe_r6_enabled ? "EN" : "DIS"); | 4330 | ppc440spe_r6_enabled ? "EN" : "DIS"); |
4330 | } | 4331 | } |
4331 | 4332 | ||
4332 | static ssize_t store_ppc440spe_r6enable(struct device_driver *dev, | 4333 | static ssize_t enable_store(struct device_driver *dev, const char *buf, |
4333 | const char *buf, size_t count) | 4334 | size_t count) |
4334 | { | 4335 | { |
4335 | unsigned long val; | 4336 | unsigned long val; |
4336 | 4337 | ||
@@ -4357,8 +4358,9 @@ static ssize_t store_ppc440spe_r6enable(struct device_driver *dev, | |||
4357 | } | 4358 | } |
4358 | return count; | 4359 | return count; |
4359 | } | 4360 | } |
4361 | static DRIVER_ATTR_RW(enable); | ||
4360 | 4362 | ||
4361 | static ssize_t show_ppc440spe_r6poly(struct device_driver *dev, char *buf) | 4363 | static ssize_t poly_store(struct device_driver *dev, char *buf) |
4362 | { | 4364 | { |
4363 | ssize_t size = 0; | 4365 | ssize_t size = 0; |
4364 | u32 reg; | 4366 | u32 reg; |
@@ -4377,8 +4379,8 @@ static ssize_t show_ppc440spe_r6poly(struct device_driver *dev, char *buf) | |||
4377 | return size; | 4379 | return size; |
4378 | } | 4380 | } |
4379 | 4381 | ||
4380 | static ssize_t store_ppc440spe_r6poly(struct device_driver *dev, | 4382 | static ssize_t poly_store(struct device_driver *dev, const char *buf, |
4381 | const char *buf, size_t count) | 4383 | size_t count) |
4382 | { | 4384 | { |
4383 | unsigned long reg, val; | 4385 | unsigned long reg, val; |
4384 | 4386 | ||
@@ -4404,12 +4406,7 @@ static ssize_t store_ppc440spe_r6poly(struct device_driver *dev, | |||
4404 | 4406 | ||
4405 | return count; | 4407 | return count; |
4406 | } | 4408 | } |
4407 | 4409 | static DRIVER_ATTR_RW(poly); | |
4408 | static DRIVER_ATTR(devices, S_IRUGO, show_ppc440spe_devices, NULL); | ||
4409 | static DRIVER_ATTR(enable, S_IRUGO | S_IWUSR, show_ppc440spe_r6enable, | ||
4410 | store_ppc440spe_r6enable); | ||
4411 | static DRIVER_ATTR(poly, S_IRUGO | S_IWUSR, show_ppc440spe_r6poly, | ||
4412 | store_ppc440spe_r6poly); | ||
4413 | 4410 | ||
4414 | /* | 4411 | /* |
4415 | * Common initialisation for RAID engines; allocate memory for | 4412 | * Common initialisation for RAID engines; allocate memory for |