[PATCH 03/11] staging: kpc2000: define all kpc_uio_class device attributes as read-only.

Jeremy Sowden jeremy at azazel.net
Thu May 16 20:04:03 UTC 2019


All of the device attributes are read-only, so use DEVICE_ATTR_RO to
define them.

Signed-off-by: Jeremy Sowden <jeremy at azazel.net>
---
 drivers/staging/kpc2000/kpc2000/cell_probe.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000/cell_probe.c b/drivers/staging/kpc2000/kpc2000/cell_probe.c
index 101eb23caaac..da15ae5b5a3d 100644
--- a/drivers/staging/kpc2000/kpc2000/cell_probe.c
+++ b/drivers/staging/kpc2000/kpc2000/cell_probe.c
@@ -229,16 +229,16 @@ static ssize_t core_num_show(struct device *dev, struct device_attribute *attr,
 	return scnprintf(buf, PAGE_SIZE, "%u\n", kudev->core_num);
 }
 
-DEVICE_ATTR(offset,       0444, offset_show,       NULL);
-DEVICE_ATTR(size,         0444, size_show,         NULL);
-DEVICE_ATTR(type,         0444, type_show,         NULL);
-DEVICE_ATTR(s2c_dma_ch,   0444, s2c_dma_ch_show,   NULL);
-DEVICE_ATTR(c2s_dma_ch,   0444, c2s_dma_ch_show,   NULL);
-DEVICE_ATTR(s2c_dma,      0444, s2c_dma_show,      NULL);
-DEVICE_ATTR(c2s_dma,      0444, c2s_dma_show,      NULL);
-DEVICE_ATTR(irq_count,    0444, irq_count_show,    NULL);
-DEVICE_ATTR(irq_base_num, 0444, irq_base_num_show, NULL);
-DEVICE_ATTR(core_num,     0444, core_num_show,     NULL);
+DEVICE_ATTR_RO(offset);
+DEVICE_ATTR_RO(size);
+DEVICE_ATTR_RO(type);
+DEVICE_ATTR_RO(s2c_dma_ch);
+DEVICE_ATTR_RO(c2s_dma_ch);
+DEVICE_ATTR_RO(s2c_dma);
+DEVICE_ATTR_RO(c2s_dma);
+DEVICE_ATTR_RO(irq_count);
+DEVICE_ATTR_RO(irq_base_num);
+DEVICE_ATTR_RO(core_num);
 
 struct attribute *kpc_uio_class_attrs[] = {
 	&dev_attr_offset.attr,
-- 
2.20.1



More information about the devel mailing list