* [PATCH] can: only rename enabled led triggers when changing the netdev name
@ 2014-05-27 11:30 Oliver Hartkopp
2014-05-27 13:00 ` Kurt Van Dijck
2014-05-28 8:06 ` Marc Kleine-Budde
0 siblings, 2 replies; 4+ messages in thread
From: Oliver Hartkopp @ 2014-05-27 11:30 UTC (permalink / raw)
To: linux-can; +Cc: dev.kurt, fabio.baltieri, Oliver Hartkopp
Commit a1ef7bd9fce8 ("can: rename LED trigger name on netdev renames") renames
the led trigger names according to the changed netdevice name.
As not every CAN driver supports and initializes the led triggers, checking for
the CAN private datastructure with safe_candev_priv() in the notifier chain is
not enough.
This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
support led triggers.
For stable 3.9+
CC: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
CC: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
drivers/net/can/led.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/can/led.c b/drivers/net/can/led.c
index a3d99a8..ab7f1b0 100644
--- a/drivers/net/can/led.c
+++ b/drivers/net/can/led.c
@@ -97,6 +97,9 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
if (!priv)
return NOTIFY_DONE;
+ if (!priv->tx_led_trig || !priv->rx_led_trig)
+ return NOTIFY_DONE;
+
if (msg == NETDEV_CHANGENAME) {
snprintf(name, sizeof(name), "%s-tx", netdev->name);
led_trigger_rename_static(name, priv->tx_led_trig);
--
2.0.0.rc4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] can: only rename enabled led triggers when changing the netdev name
2014-05-27 11:30 [PATCH] can: only rename enabled led triggers when changing the netdev name Oliver Hartkopp
@ 2014-05-27 13:00 ` Kurt Van Dijck
2014-05-28 8:06 ` Marc Kleine-Budde
1 sibling, 0 replies; 4+ messages in thread
From: Kurt Van Dijck @ 2014-05-27 13:00 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: linux-can, fabio.baltieri
Hey Oliver,
nice clean patch.
Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
On Tue, May 27, 2014 at 01:30:56PM +0200, Oliver Hartkopp wrote:
> Commit a1ef7bd9fce8 ("can: rename LED trigger name on netdev renames") renames
> the led trigger names according to the changed netdevice name.
>
> As not every CAN driver supports and initializes the led triggers, checking for
> the CAN private datastructure with safe_candev_priv() in the notifier chain is
> not enough.
>
> This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
> support led triggers.
>
> For stable 3.9+
>
> CC: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
> CC: Fabio Baltieri <fabio.baltieri@gmail.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> ---
> drivers/net/can/led.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/can/led.c b/drivers/net/can/led.c
> index a3d99a8..ab7f1b0 100644
> --- a/drivers/net/can/led.c
> +++ b/drivers/net/can/led.c
> @@ -97,6 +97,9 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
> if (!priv)
> return NOTIFY_DONE;
>
> + if (!priv->tx_led_trig || !priv->rx_led_trig)
> + return NOTIFY_DONE;
> +
> if (msg == NETDEV_CHANGENAME) {
> snprintf(name, sizeof(name), "%s-tx", netdev->name);
> led_trigger_rename_static(name, priv->tx_led_trig);
> --
> 2.0.0.rc4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] can: only rename enabled led triggers when changing the netdev name
2014-05-27 11:30 [PATCH] can: only rename enabled led triggers when changing the netdev name Oliver Hartkopp
2014-05-27 13:00 ` Kurt Van Dijck
@ 2014-05-28 8:06 ` Marc Kleine-Budde
1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2014-05-28 8:06 UTC (permalink / raw)
To: Oliver Hartkopp, linux-can; +Cc: dev.kurt, fabio.baltieri
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
On 05/27/2014 01:30 PM, Oliver Hartkopp wrote:
> Commit a1ef7bd9fce8 ("can: rename LED trigger name on netdev renames") renames
> the led trigger names according to the changed netdevice name.
>
> As not every CAN driver supports and initializes the led triggers, checking for
> the CAN private datastructure with safe_candev_priv() in the notifier chain is
> not enough.
>
> This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
> support led triggers.
>
> For stable 3.9+
>
> CC: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
> CC: Fabio Baltieri <fabio.baltieri@gmail.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Applied to can.
Thanks,
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 |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* pull-request: can 2014-05-28
@ 2014-05-28 8:04 Marc Kleine-Budde
2014-05-28 8:04 ` [PATCH] can: only rename enabled led triggers when changing the netdev name Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2014-05-28 8:04 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel
Hello David,
here's a pull request for v3.15, hope it's not too late.
Oliver Hartkopp fixed a bug in the CAN led trigger device renaming code.
regards,
Marc
---
The following changes since commit 8646224cdb945eca4293e2131e5be47930ce3e80:
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless (2014-05-24 14:06:19 -0400)
are available in the git repository at:
git://gitorious.org/linux-can/linux-can.git tags/linux-can-fixes-for-3.15-20140528
for you to fetch changes up to 45fb4f8d81578e0a17c45c4593a3305afbf7a48b:
can: only rename enabled led triggers when changing the netdev name (2014-05-27 15:05:41 +0200)
----------------------------------------------------------------
linux-can-fixes-for-3.15-20140528
----------------------------------------------------------------
Oliver Hartkopp (1):
can: only rename enabled led triggers when changing the netdev name
drivers/net/can/led.c | 3 +++
1 file changed, 3 insertions(+)
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] can: only rename enabled led triggers when changing the netdev name
2014-05-28 8:04 pull-request: can 2014-05-28 Marc Kleine-Budde
@ 2014-05-28 8:04 ` Marc Kleine-Budde
0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2014-05-28 8:04 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Oliver Hartkopp, Fabio Baltieri,
linux-stable, Marc Kleine-Budde
From: Oliver Hartkopp <socketcan@hartkopp.net>
Commit a1ef7bd9fce8 ("can: rename LED trigger name on netdev renames") renames
the led trigger names according to the changed netdevice name.
As not every CAN driver supports and initializes the led triggers, checking for
the CAN private datastructure with safe_candev_priv() in the notifier chain is
not enough.
This patch adds a check when CONFIG_CAN_LEDS is enabled and the driver does not
support led triggers.
Cc: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Kurt Van Dijck <dev.kurt@vandijck-laurijssen.be>
Cc: linux-stable <stable@vger.kernel.org> # >= v3.9
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/led.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/can/led.c b/drivers/net/can/led.c
index a3d99a8..ab7f1b0 100644
--- a/drivers/net/can/led.c
+++ b/drivers/net/can/led.c
@@ -97,6 +97,9 @@ static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
if (!priv)
return NOTIFY_DONE;
+ if (!priv->tx_led_trig || !priv->rx_led_trig)
+ return NOTIFY_DONE;
+
if (msg == NETDEV_CHANGENAME) {
snprintf(name, sizeof(name), "%s-tx", netdev->name);
led_trigger_rename_static(name, priv->tx_led_trig);
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-05-28 8:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-27 11:30 [PATCH] can: only rename enabled led triggers when changing the netdev name Oliver Hartkopp
2014-05-27 13:00 ` Kurt Van Dijck
2014-05-28 8:06 ` Marc Kleine-Budde
-- strict thread matches above, loose matches on Subject: below --
2014-05-28 8:04 pull-request: can 2014-05-28 Marc Kleine-Budde
2014-05-28 8:04 ` [PATCH] can: only rename enabled led triggers when changing the netdev name Marc Kleine-Budde
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.