can: only rename enabled led triggers when changing the netdev name
can: only rename enabled led triggers when changing the netdev name

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: Fabio Baltieri <161d407f4dc681bfd4aedb33b8273b2aafd727bc@gmail.com>
Signed-off-by: Oliver Hartkopp <06a38fb2ed1a2d0a17f4f06761ac2e5ace5a31ab@hartkopp.net>
Acked-by: Kurt Van Dijck <ca6d04ba53d372cd03b2f80209146c5d5ebbc6ec@vandijck-laurijssen.be>
Cc: linux-stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <4a0ea1158d3cc63151119c05b1bff00c0bdbf421@pengutronix.de>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs