mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 23:25:54 +00:00
rt2x00: increase led's name buffer length
With 9-letter driver names phy's number was truncated to two characters, which caused warnings when creating sysfs entries for leds on systems with multiple devices. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
d6b6fc14f0
commit
4272a27f2f
@ -124,17 +124,15 @@ static int rt2x00leds_register_led(struct rt2x00_dev *rt2x00dev,
|
||||
|
||||
void rt2x00leds_register(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
char dev_name[16];
|
||||
char name[32];
|
||||
char name[36];
|
||||
int retval;
|
||||
unsigned long on_period;
|
||||
unsigned long off_period;
|
||||
|
||||
snprintf(dev_name, sizeof(dev_name), "%s-%s",
|
||||
rt2x00dev->ops->name, wiphy_name(rt2x00dev->hw->wiphy));
|
||||
const char *phy_name = wiphy_name(rt2x00dev->hw->wiphy);
|
||||
|
||||
if (rt2x00dev->led_radio.flags & LED_INITIALIZED) {
|
||||
snprintf(name, sizeof(name), "%s::radio", dev_name);
|
||||
snprintf(name, sizeof(name), "%s-%s::radio",
|
||||
rt2x00dev->ops->name, phy_name);
|
||||
|
||||
retval = rt2x00leds_register_led(rt2x00dev,
|
||||
&rt2x00dev->led_radio,
|
||||
@ -144,7 +142,8 @@ void rt2x00leds_register(struct rt2x00_dev *rt2x00dev)
|
||||
}
|
||||
|
||||
if (rt2x00dev->led_assoc.flags & LED_INITIALIZED) {
|
||||
snprintf(name, sizeof(name), "%s::assoc", dev_name);
|
||||
snprintf(name, sizeof(name), "%s-%s::assoc",
|
||||
rt2x00dev->ops->name, phy_name);
|
||||
|
||||
retval = rt2x00leds_register_led(rt2x00dev,
|
||||
&rt2x00dev->led_assoc,
|
||||
@ -154,7 +153,8 @@ void rt2x00leds_register(struct rt2x00_dev *rt2x00dev)
|
||||
}
|
||||
|
||||
if (rt2x00dev->led_qual.flags & LED_INITIALIZED) {
|
||||
snprintf(name, sizeof(name), "%s::quality", dev_name);
|
||||
snprintf(name, sizeof(name), "%s-%s::quality",
|
||||
rt2x00dev->ops->name, phy_name);
|
||||
|
||||
retval = rt2x00leds_register_led(rt2x00dev,
|
||||
&rt2x00dev->led_qual,
|
||||
|
Loading…
Reference in New Issue
Block a user