From patchwork Wed Feb 18 16:20:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 5845061 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA7149F373 for ; Wed, 18 Feb 2015 16:21:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C873020256 for ; Wed, 18 Feb 2015 16:21:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01BFE20225 for ; Wed, 18 Feb 2015 16:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbbBRQVn (ORCPT ); Wed, 18 Feb 2015 11:21:43 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:62429 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbbBRQVl (ORCPT ); Wed, 18 Feb 2015 11:21:41 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NJZ00K9X6S3SP30@mailout4.samsung.com>; Thu, 19 Feb 2015 01:21:39 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-0c-54e4bc13e1a0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 41.B3.09430.31CB4E45; Thu, 19 Feb 2015 01:21:39 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NJZ003WS6QJDJ20@mmp1.samsung.com>; Thu, 19 Feb 2015 01:21:39 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org Cc: kyungmin.park@samsung.com, pavel@ucw.cz, cooloney@gmail.com, rpurdie@rpsys.net, sakari.ailus@iki.fi, s.nawrocki@samsung.com, Jacek Anaszewski Subject: [PATCH/RFC v11 02/20] leds: flash: Improve sync strobe related sysfs attributes Date: Wed, 18 Feb 2015 17:20:23 +0100 Message-id: <1424276441-3969-3-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1424276441-3969-1-git-send-email-j.anaszewski@samsung.com> References: <1424276441-3969-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t9jAV3hPU9CDG6sVbA4unMik8X8I+dY LXqvPme0ONv0ht1i65t1jBY9G7ayWtw9dZTNYveup6wWh9+0s1qc2b+SzYHLY+esu+weh78u ZPHYM/8Hq0ffllWMHitWf2f3+LxJLoAtissmJTUnsyy1SN8ugStj8sRr7AUHuCsW33/H3MB4 kLOLkZNDQsBE4uWMfYwQtpjEhXvr2boYuTiEBBYxSvydNIEFwmlnkrgy/zcLSBWbgKHEzxev mUBsEYFIiXdHLzGDFDELbGCUuDyhEaxIWCBK4unRo2wgNouAqsTUKXvAbF4Bd4mVf2YAreMA WqcgMWeSDYjJKeAhceG5B0iFEFDF9JvvWCcw8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpec n7uJERx8z6R3MK5qsDjEKMDBqMTD2/D7cYgQa2JZcWXuIUYJDmYlEd7clU9ChHhTEiurUovy 44tKc1KLDzFKc7AoifMq2beFCAmkJ5akZqemFqQWwWSZODilGhiFJn841fNSaarxxH2NxoUz 9Xx0S/kXNc+xXcrf8GR617f0p0f/1L2pPNAlatR+QNI7bEr6w7mp3YdWVWdOXZKVV/R7Uebq R2vD6w/5CtyRlK29lf3I5pnZyiduTaZb9vZrSJh5sTwsyf1+fWrkt6If+YF1vdYrN+dYzWMS 2f9CuemBj5RknrgSS3FGoqEWc1FxIgBMS8mQOgIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Kyungmin Park Cc: Bryan Wu Cc: Richard Purdie --- 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);