diff options
Diffstat (limited to 'drivers/net/wireless/libertas/debugfs.c')
-rw-r--r-- | drivers/net/wireless/libertas/debugfs.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c index 893a55ca344..587b0cb0088 100644 --- a/drivers/net/wireless/libertas/debugfs.c +++ b/drivers/net/wireless/libertas/debugfs.c | |||
@@ -451,10 +451,12 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf, | |||
451 | CMD_MAC_REG_ACCESS, 0, | 451 | CMD_MAC_REG_ACCESS, 0, |
452 | CMD_OPTION_WAITFORRSP, 0, &offval); | 452 | CMD_OPTION_WAITFORRSP, 0, &offval); |
453 | mdelay(10); | 453 | mdelay(10); |
454 | pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", | 454 | if (!ret) { |
455 | pos += snprintf(buf+pos, len-pos, "MAC[0x%x] = 0x%08x\n", | ||
455 | priv->mac_offset, priv->offsetvalue.value); | 456 | priv->mac_offset, priv->offsetvalue.value); |
456 | 457 | ||
457 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 458 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
459 | } | ||
458 | free_page(addr); | 460 | free_page(addr); |
459 | return ret; | 461 | return ret; |
460 | } | 462 | } |
@@ -514,7 +516,8 @@ static ssize_t lbs_wrmac_write(struct file *file, | |||
514 | CMD_OPTION_WAITFORRSP, 0, &offval); | 516 | CMD_OPTION_WAITFORRSP, 0, &offval); |
515 | mdelay(10); | 517 | mdelay(10); |
516 | 518 | ||
517 | res = count; | 519 | if (!res) |
520 | res = count; | ||
518 | out_unlock: | 521 | out_unlock: |
519 | free_page(addr); | 522 | free_page(addr); |
520 | return res; | 523 | return res; |
@@ -539,10 +542,12 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf, | |||
539 | CMD_BBP_REG_ACCESS, 0, | 542 | CMD_BBP_REG_ACCESS, 0, |
540 | CMD_OPTION_WAITFORRSP, 0, &offval); | 543 | CMD_OPTION_WAITFORRSP, 0, &offval); |
541 | mdelay(10); | 544 | mdelay(10); |
542 | pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", | 545 | if (!ret) { |
546 | pos += snprintf(buf+pos, len-pos, "BBP[0x%x] = 0x%08x\n", | ||
543 | priv->bbp_offset, priv->offsetvalue.value); | 547 | priv->bbp_offset, priv->offsetvalue.value); |
544 | 548 | ||
545 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 549 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
550 | } | ||
546 | free_page(addr); | 551 | free_page(addr); |
547 | 552 | ||
548 | return ret; | 553 | return ret; |
@@ -603,7 +608,8 @@ static ssize_t lbs_wrbbp_write(struct file *file, | |||
603 | CMD_OPTION_WAITFORRSP, 0, &offval); | 608 | CMD_OPTION_WAITFORRSP, 0, &offval); |
604 | mdelay(10); | 609 | mdelay(10); |
605 | 610 | ||
606 | res = count; | 611 | if (!res) |
612 | res = count; | ||
607 | out_unlock: | 613 | out_unlock: |
608 | free_page(addr); | 614 | free_page(addr); |
609 | return res; | 615 | return res; |
@@ -628,10 +634,12 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf, | |||
628 | CMD_RF_REG_ACCESS, 0, | 634 | CMD_RF_REG_ACCESS, 0, |
629 | CMD_OPTION_WAITFORRSP, 0, &offval); | 635 | CMD_OPTION_WAITFORRSP, 0, &offval); |
630 | mdelay(10); | 636 | mdelay(10); |
631 | pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", | 637 | if (!ret) { |
638 | pos += snprintf(buf+pos, len-pos, "RF[0x%x] = 0x%08x\n", | ||
632 | priv->rf_offset, priv->offsetvalue.value); | 639 | priv->rf_offset, priv->offsetvalue.value); |
633 | 640 | ||
634 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); | 641 | ret = simple_read_from_buffer(userbuf, count, ppos, buf, pos); |
642 | } | ||
635 | free_page(addr); | 643 | free_page(addr); |
636 | 644 | ||
637 | return ret; | 645 | return ret; |
@@ -692,7 +700,8 @@ static ssize_t lbs_wrrf_write(struct file *file, | |||
692 | CMD_OPTION_WAITFORRSP, 0, &offval); | 700 | CMD_OPTION_WAITFORRSP, 0, &offval); |
693 | mdelay(10); | 701 | mdelay(10); |
694 | 702 | ||
695 | res = count; | 703 | if (!res) |
704 | res = count; | ||
696 | out_unlock: | 705 | out_unlock: |
697 | free_page(addr); | 706 | free_page(addr); |
698 | return res; | 707 | return res; |