[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <501998D4.2040206@pengutronix.de>
Date: Wed, 01 Aug 2012 23:00:04 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Fabio Baltieri <fabio.baltieri@...il.com>
CC: linux-can@...r.kernel.org, linux-kernel@...r.kernel.org,
Oliver Hartkopp <socketcan@...tkopp.net>,
Wolfgang Grandegger <wg@...ndegger.com>
Subject: Re: [PATCH can-next v6] can: add tx/rx LED trigger support
On 08/01/2012 08:21 PM, Fabio Baltieri wrote:
> This patch implements the functions to add two LED triggers, named
> <ifname>-tx and <ifname>-rx, to a canbus device driver.
>
> Triggers are called from specific handlers by each CAN device driver and
> can be disabled altogether with a Kconfig option.
>
> The implementation keeps the LED on when the interface is UP and blinks
> the LED on network activity at a configurable rate.
>
> This only supports can-dev based drivers, as it uses some support field
> in the can_priv structure.
>
> Supported drivers should call devm_can_led_init() and can_led_event() as
> needed.
>
> Cleanup is handled automatically by devres, so no *_exit function is
> needed.
>
> Supported events are:
> - CAN_LED_EVENT_OPEN: turn on tx/rx LEDs
> - CAN_LED_EVENT_STOP: turn off tx/rx LEDs
> - CAN_LED_EVENT_TX: trigger tx LED blink
> - CAN_LED_EVENT_RX: trigger tx LED blink
>
> Cc: Oliver Hartkopp <socketcan@...tkopp.net>
> Cc: Wolfgang Grandegger <wg@...ndegger.com>
> Cc: Marc Kleine-Budde <mkl@...gutronix.de>
> Signed-off-by: Fabio Baltieri <fabio.baltieri@...il.com>
> ---
>
> Hi all,
>
> so, v6, change trigger names for fixed size allocation capped to (IFNAMSIZ + 4)
> and removed kasprintf as suggested by Oliver (thanks!).
>
> This also has the side effect of reducing the error path to just one check to
> devres_alloc return value... nice!
>
> I've put CAN_LED_NAME_SZ definition with the active function declaration,
> but used sizeof(priv->tx_led_trig_name) as snprintf length argument in the
> code, as it looks cleaner to me.
>
> I'm not reposting the flexcan patch as it's not affected by the change.
Pushed to can-next/master, it even compiles now, as David has included
some upstream branches.
I'm still taking Tested- and Acked-by for these patches.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Download attachment "signature.asc" of type "application/pgp-signature" (263 bytes)
Powered by blists - more mailing lists