[PATCH/RFC v11 02/20] leds: flash: Improve sync strobe related sysfs attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Current format of synchronized strobe related attributes introduces
problems when it comes to parsing. Avoding the usage of square brackets
and colons makes the parsing more convenient.

Signed-off-by: Jacek Anaszewski <j.anaszewski@xxxxxxxxxxx>
Acked-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
Cc: Bryan Wu <cooloney@xxxxxxxxx>
Cc: Richard Purdie <rpurdie@xxxxxxxxx>
---
 drivers/leds/led-class-flash.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/led-class-flash.c b/drivers/leds/led-class-flash.c
index 4a19fd4..a2da52e 100644
--- a/drivers/leds/led-class-flash.c
+++ b/drivers/leds/led-class-flash.c
@@ -224,11 +224,11 @@ static ssize_t available_sync_leds_show(struct device *dev,
 	char *pbuf = buf;
 	int i, buf_len;
 
-	buf_len = sprintf(pbuf, "[0: none] ");
+	buf_len = sprintf(pbuf, "0.none ");
 	pbuf += buf_len;
 
 	for (i = 0; i < fled_cdev->num_sync_leds; ++i) {
-		buf_len = sprintf(pbuf, "[%d: %s] ", i + 1,
+		buf_len = sprintf(pbuf, "%d.%s ", i + 1,
 				  fled_cdev->sync_leds[i]->led_cdev.name);
 		pbuf += buf_len;
 	}
@@ -281,7 +281,7 @@ static ssize_t flash_sync_strobe_show(struct device *dev,
 		sync_led_name = (char *)
 			fled_cdev->sync_leds[sled_id - 1]->led_cdev.name;
 
-	return sprintf(buf, "[%d: %s]\n", sled_id, sync_led_name);
+	return sprintf(buf, "%d.%s\n", sled_id, sync_led_name);
 }
 static DEVICE_ATTR_RW(flash_sync_strobe);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux