From: David Lechner <david@lechnology.com>
To: Richard Purdie <rpurdie@rpsys.net>,
Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: David Lechner <david@lechnology.com>,
linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org,
Marcel Holtmann <marcel@holtmann.org>,
Pavel Machek <pavel@ucw.cz>
Subject: [PATCH v4 2/3] leds: Use macro for max device node name size
Date: Fri, 16 Sep 2016 14:16:49 -0500 [thread overview]
Message-ID: <1474053410-24387-3-git-send-email-david@lechnology.com> (raw)
In-Reply-To: <1474053410-24387-1-git-send-email-david@lechnology.com>
Use a macro instead of hard-coding the max device node name size. The
uleds driver introduced a macro for this value, so using it.
Signed-off-by: David Lechner <david@lechnology.com>
---
drivers/leds/led-class.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index aa84e5b..731e4eb 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -20,6 +20,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/timer.h>
+#include <uapi/linux/uleds.h>
#include "leds.h"
static struct class *leds_class;
@@ -187,7 +188,7 @@ static int led_classdev_next_name(const char *init_name, char *name,
*/
int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
{
- char name[64];
+ char name[LEDS_MAX_NAME_SIZE];
int ret;
ret = led_classdev_next_name(led_cdev->name, name, sizeof(name));
--
2.7.4
next prev parent reply other threads:[~2016-09-16 19:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20160916191750eucas1p2437e0fa04cc99964b79cb774ef482e5a@eucas1p2.samsung.com>
2016-09-16 19:16 ` [PATCH v4 0/3] leds: Introduce userspace leds driver David Lechner
2016-09-16 19:16 ` [PATCH v4 1/3] " David Lechner
2016-09-22 13:43 ` Linus Walleij
2016-09-22 13:44 ` Linus Walleij
2016-09-22 16:45 ` David Lechner
2016-09-24 12:06 ` Pavel Machek
2016-11-08 11:26 ` Jacek Anaszewski
2016-11-08 19:08 ` David Lechner
2016-11-08 20:29 ` Jacek Anaszewski
2016-11-09 7:05 ` Pavel Machek
2016-11-09 8:44 ` Jacek Anaszewski
2016-09-16 19:16 ` David Lechner [this message]
2016-09-16 19:16 ` [PATCH v4 3/3] tools/leds: Add uledmon program for monitoring userspace LEDs David Lechner
2016-09-20 8:56 ` [PATCH v4 0/3] leds: Introduce userspace leds driver Jacek Anaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474053410-24387-3-git-send-email-david@lechnology.com \
--to=david@lechnology.com \
--cc=j.anaszewski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=pavel@ucw.cz \
--cc=rpurdie@rpsys.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).