[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160626214902.GB21026@amd>
Date: Sun, 26 Jun 2016 23:49:02 +0200
From: Pavel Machek <pavel@....cz>
To: Jacek Anaszewski <j.anaszewski@...sung.com>
Cc: Florian Vaussard <florian.vaussard@...il.com>,
devicetree@...r.kernel.org, Richard Purdie <rpurdie@...ys.net>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
Florian Vaussard <florian.vaussard@...g-vd.ch>
Subject: Re: [PATCH 2/2] leds: Add driver for NCP5623 3-channel I2C LED driver
Hi!
> >+struct ncp5623_led {
> >+ bool active;
> >+ unsigned int led_no;
> >+ struct led_classdev ldev;
> >+ struct work_struct work;
> >+ struct ncp5623_priv *priv;
> >+};
> >+
> >+struct ncp5623_priv {
> >+ struct ncp5623_led leds[NCP5623_MAX_LEDS];
>
> Please allocate memory dynamically, depending on the number
> of LEDs defined in a Device Tree.
MAX_LEDs is three. Are you sure overhead of dynamic allocation is
worth it?
And if this is for RGB leds... very probably device will want to use
all 3 channels.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Powered by blists - more mailing lists