aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/docg3.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-09-29 19:08:27 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-10-22 01:28:57 -0400
commit8c98d2554f715260efb3e779a9cfe045c4af8aa0 (patch)
tree10bc1af1c00f2b67add675f2dbc3cb6e28f00927 /drivers/mtd/devices/docg3.c
parent577267f39cc10981a36cc8d3ee274806256a6232 (diff)
docg3: Fix miuse of seq_printf return value
seq_printf doesn't return a useful value, so remove these misuses. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/devices/docg3.c')
-rw-r--r--drivers/mtd/devices/docg3.c112
1 files changed, 52 insertions, 60 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 21cc4b66feaa..68ff83cc6660 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1655,22 +1655,21 @@ static int dbg_flashctrl_show(struct seq_file *s, void *p)
1655{ 1655{
1656 struct docg3 *docg3 = (struct docg3 *)s->private; 1656 struct docg3 *docg3 = (struct docg3 *)s->private;
1657 1657
1658 int pos = 0;
1659 u8 fctrl; 1658 u8 fctrl;
1660 1659
1661 mutex_lock(&docg3->cascade->lock); 1660 mutex_lock(&docg3->cascade->lock);
1662 fctrl = doc_register_readb(docg3, DOC_FLASHCONTROL); 1661 fctrl = doc_register_readb(docg3, DOC_FLASHCONTROL);
1663 mutex_unlock(&docg3->cascade->lock); 1662 mutex_unlock(&docg3->cascade->lock);
1664 1663
1665 pos += seq_printf(s, 1664 seq_printf(s, "FlashControl : 0x%02x (%s,CE# %s,%s,%s,flash %s)\n",
1666 "FlashControl : 0x%02x (%s,CE# %s,%s,%s,flash %s)\n", 1665 fctrl,
1667 fctrl, 1666 fctrl & DOC_CTRL_VIOLATION ? "protocol violation" : "-",
1668 fctrl & DOC_CTRL_VIOLATION ? "protocol violation" : "-", 1667 fctrl & DOC_CTRL_CE ? "active" : "inactive",
1669 fctrl & DOC_CTRL_CE ? "active" : "inactive", 1668 fctrl & DOC_CTRL_PROTECTION_ERROR ? "protection error" : "-",
1670 fctrl & DOC_CTRL_PROTECTION_ERROR ? "protection error" : "-", 1669 fctrl & DOC_CTRL_SEQUENCE_ERROR ? "sequence error" : "-",
1671 fctrl & DOC_CTRL_SEQUENCE_ERROR ? "sequence error" : "-", 1670 fctrl & DOC_CTRL_FLASHREADY ? "ready" : "not ready");
1672 fctrl & DOC_CTRL_FLASHREADY ? "ready" : "not ready"); 1671
1673 return pos; 1672 return 0;
1674} 1673}
1675DEBUGFS_RO_ATTR(flashcontrol, dbg_flashctrl_show); 1674DEBUGFS_RO_ATTR(flashcontrol, dbg_flashctrl_show);
1676 1675
@@ -1678,58 +1677,56 @@ static int dbg_asicmode_show(struct seq_file *s, void *p)
1678{ 1677{
1679 struct docg3 *docg3 = (struct docg3 *)s->private; 1678 struct docg3 *docg3 = (struct docg3 *)s->private;
1680 1679
1681 int pos = 0, pctrl, mode; 1680 int pctrl, mode;
1682 1681
1683 mutex_lock(&docg3->cascade->lock); 1682 mutex_lock(&docg3->cascade->lock);
1684 pctrl = doc_register_readb(docg3, DOC_ASICMODE); 1683 pctrl = doc_register_readb(docg3, DOC_ASICMODE);
1685 mode = pctrl & 0x03; 1684 mode = pctrl & 0x03;
1686 mutex_unlock(&docg3->cascade->lock); 1685 mutex_unlock(&docg3->cascade->lock);
1687 1686
1688 pos += seq_printf(s, 1687 seq_printf(s,
1689 "%04x : RAM_WE=%d,RSTIN_RESET=%d,BDETCT_RESET=%d,WRITE_ENABLE=%d,POWERDOWN=%d,MODE=%d%d (", 1688 "%04x : RAM_WE=%d,RSTIN_RESET=%d,BDETCT_RESET=%d,WRITE_ENABLE=%d,POWERDOWN=%d,MODE=%d%d (",
1690 pctrl, 1689 pctrl,
1691 pctrl & DOC_ASICMODE_RAM_WE ? 1 : 0, 1690 pctrl & DOC_ASICMODE_RAM_WE ? 1 : 0,
1692 pctrl & DOC_ASICMODE_RSTIN_RESET ? 1 : 0, 1691 pctrl & DOC_ASICMODE_RSTIN_RESET ? 1 : 0,
1693 pctrl & DOC_ASICMODE_BDETCT_RESET ? 1 : 0, 1692 pctrl & DOC_ASICMODE_BDETCT_RESET ? 1 : 0,
1694 pctrl & DOC_ASICMODE_MDWREN ? 1 : 0, 1693 pctrl & DOC_ASICMODE_MDWREN ? 1 : 0,
1695 pctrl & DOC_ASICMODE_POWERDOWN ? 1 : 0, 1694 pctrl & DOC_ASICMODE_POWERDOWN ? 1 : 0,
1696 mode >> 1, mode & 0x1); 1695 mode >> 1, mode & 0x1);
1697 1696
1698 switch (mode) { 1697 switch (mode) {
1699 case DOC_ASICMODE_RESET: 1698 case DOC_ASICMODE_RESET:
1700 pos += seq_puts(s, "reset"); 1699 seq_puts(s, "reset");
1701 break; 1700 break;
1702 case DOC_ASICMODE_NORMAL: 1701 case DOC_ASICMODE_NORMAL:
1703 pos += seq_puts(s, "normal"); 1702 seq_puts(s, "normal");
1704 break; 1703 break;
1705 case DOC_ASICMODE_POWERDOWN: 1704 case DOC_ASICMODE_POWERDOWN:
1706 pos += seq_puts(s, "powerdown"); 1705 seq_puts(s, "powerdown");
1707 break; 1706 break;
1708 } 1707 }
1709 pos += seq_puts(s, ")\n"); 1708 seq_puts(s, ")\n");
1710 return pos; 1709 return 0;
1711} 1710}
1712DEBUGFS_RO_ATTR(asic_mode, dbg_asicmode_show); 1711DEBUGFS_RO_ATTR(asic_mode, dbg_asicmode_show);
1713 1712
1714static int dbg_device_id_show(struct seq_file *s, void *p) 1713static int dbg_device_id_show(struct seq_file *s, void *p)
1715{ 1714{
1716 struct docg3 *docg3 = (struct docg3 *)s->private; 1715 struct docg3 *docg3 = (struct docg3 *)s->private;
1717 int pos = 0;
1718 int id; 1716 int id;
1719 1717
1720 mutex_lock(&docg3->cascade->lock); 1718 mutex_lock(&docg3->cascade->lock);
1721 id = doc_register_readb(docg3, DOC_DEVICESELECT); 1719 id = doc_register_readb(docg3, DOC_DEVICESELECT);
1722 mutex_unlock(&docg3->cascade->lock); 1720 mutex_unlock(&docg3->cascade->lock);
1723 1721
1724 pos += seq_printf(s, "DeviceId = %d\n", id); 1722 seq_printf(s, "DeviceId = %d\n", id);
1725 return pos; 1723 return 0;
1726} 1724}
1727DEBUGFS_RO_ATTR(device_id, dbg_device_id_show); 1725DEBUGFS_RO_ATTR(device_id, dbg_device_id_show);
1728 1726
1729static int dbg_protection_show(struct seq_file *s, void *p) 1727static int dbg_protection_show(struct seq_file *s, void *p)
1730{ 1728{
1731 struct docg3 *docg3 = (struct docg3 *)s->private; 1729 struct docg3 *docg3 = (struct docg3 *)s->private;
1732 int pos = 0;
1733 int protect, dps0, dps0_low, dps0_high, dps1, dps1_low, dps1_high; 1730 int protect, dps0, dps0_low, dps0_high, dps1, dps1_low, dps1_high;
1734 1731
1735 mutex_lock(&docg3->cascade->lock); 1732 mutex_lock(&docg3->cascade->lock);
@@ -1742,45 +1739,40 @@ static int dbg_protection_show(struct seq_file *s, void *p)
1742 dps1_high = doc_register_readw(docg3, DOC_DPS1_ADDRHIGH); 1739 dps1_high = doc_register_readw(docg3, DOC_DPS1_ADDRHIGH);
1743 mutex_unlock(&docg3->cascade->lock); 1740 mutex_unlock(&docg3->cascade->lock);
1744 1741
1745 pos += seq_printf(s, "Protection = 0x%02x (", 1742 seq_printf(s, "Protection = 0x%02x (", protect);
1746 protect);
1747 if (protect & DOC_PROTECT_FOUNDRY_OTP_LOCK) 1743 if (protect & DOC_PROTECT_FOUNDRY_OTP_LOCK)
1748 pos += seq_puts(s, "FOUNDRY_OTP_LOCK,"); 1744 seq_puts(s, "FOUNDRY_OTP_LOCK,");
1749 if (protect & DOC_PROTECT_CUSTOMER_OTP_LOCK) 1745 if (protect & DOC_PROTECT_CUSTOMER_OTP_LOCK)
1750 pos += seq_puts(s, "CUSTOMER_OTP_LOCK,"); 1746 seq_puts(s, "CUSTOMER_OTP_LOCK,");
1751 if (protect & DOC_PROTECT_LOCK_INPUT) 1747 if (protect & DOC_PROTECT_LOCK_INPUT)
1752 pos += seq_puts(s, "LOCK_INPUT,"); 1748 seq_puts(s, "LOCK_INPUT,");
1753 if (protect & DOC_PROTECT_STICKY_LOCK) 1749 if (protect & DOC_PROTECT_STICKY_LOCK)
1754 pos += seq_puts(s, "STICKY_LOCK,"); 1750 seq_puts(s, "STICKY_LOCK,");
1755 if (protect & DOC_PROTECT_PROTECTION_ENABLED) 1751 if (protect & DOC_PROTECT_PROTECTION_ENABLED)
1756 pos += seq_puts(s, "PROTECTION ON,"); 1752 seq_puts(s, "PROTECTION ON,");
1757 if (protect & DOC_PROTECT_IPL_DOWNLOAD_LOCK) 1753 if (protect & DOC_PROTECT_IPL_DOWNLOAD_LOCK)
1758 pos += seq_puts(s, "IPL_DOWNLOAD_LOCK,"); 1754 seq_puts(s, "IPL_DOWNLOAD_LOCK,");
1759 if (protect & DOC_PROTECT_PROTECTION_ERROR) 1755 if (protect & DOC_PROTECT_PROTECTION_ERROR)
1760 pos += seq_puts(s, "PROTECT_ERR,"); 1756 seq_puts(s, "PROTECT_ERR,");
1761 else 1757 else
1762 pos += seq_puts(s, "NO_PROTECT_ERR"); 1758 seq_puts(s, "NO_PROTECT_ERR");
1763 pos += seq_puts(s, ")\n"); 1759 seq_puts(s, ")\n");
1764 1760
1765 pos += seq_printf(s, "DPS0 = 0x%02x : " 1761 seq_printf(s, "DPS0 = 0x%02x : Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n",
1766 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, " 1762 dps0, dps0_low, dps0_high,
1767 "WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n", 1763 !!(dps0 & DOC_DPS_OTP_PROTECTED),
1768 dps0, dps0_low, dps0_high, 1764 !!(dps0 & DOC_DPS_READ_PROTECTED),
1769 !!(dps0 & DOC_DPS_OTP_PROTECTED), 1765 !!(dps0 & DOC_DPS_WRITE_PROTECTED),
1770 !!(dps0 & DOC_DPS_READ_PROTECTED), 1766 !!(dps0 & DOC_DPS_HW_LOCK_ENABLED),
1771 !!(dps0 & DOC_DPS_WRITE_PROTECTED), 1767 !!(dps0 & DOC_DPS_KEY_OK));
1772 !!(dps0 & DOC_DPS_HW_LOCK_ENABLED), 1768 seq_printf(s, "DPS1 = 0x%02x : Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n",
1773 !!(dps0 & DOC_DPS_KEY_OK)); 1769 dps1, dps1_low, dps1_high,
1774 pos += seq_printf(s, "DPS1 = 0x%02x : " 1770 !!(dps1 & DOC_DPS_OTP_PROTECTED),
1775 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, " 1771 !!(dps1 & DOC_DPS_READ_PROTECTED),
1776 "WRITE=%d, HW_LOCK=%d, KEY_OK=%d\n", 1772 !!(dps1 & DOC_DPS_WRITE_PROTECTED),
1777 dps1, dps1_low, dps1_high, 1773 !!(dps1 & DOC_DPS_HW_LOCK_ENABLED),
1778 !!(dps1 & DOC_DPS_OTP_PROTECTED), 1774 !!(dps1 & DOC_DPS_KEY_OK));
1779 !!(dps1 & DOC_DPS_READ_PROTECTED), 1775 return 0;
1780 !!(dps1 & DOC_DPS_WRITE_PROTECTED),
1781 !!(dps1 & DOC_DPS_HW_LOCK_ENABLED),
1782 !!(dps1 & DOC_DPS_KEY_OK));
1783 return pos;
1784} 1776}
1785DEBUGFS_RO_ATTR(protection, dbg_protection_show); 1777DEBUGFS_RO_ATTR(protection, dbg_protection_show);
1786 1778