tree: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git rtc-next head: 3e24d863354b8cdb3a2f369ddfd3b02396ae87dd commit: a650629f205a5d48b5562300fd832dc9c287702b [21/27] rtc: ds1307: add frequency_test_enable sysfs attribute to check tick on m41txx config: i386-randconfig-x008-201837 (attached as .config) compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce: git checkout a650629f205a5d48b5562300fd832dc9c287702b # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>): drivers/rtc/rtc-ds1307.c: In function 'ds1307_probe': >> drivers/rtc/rtc-ds1307.c:1885:3: error: implicit declaration of function >> 'rtc_device_unregister'; did you mean 'root_device_unregister'? >> [-Werror=implicit-function-declaration] rtc_device_unregister(ds1307->rtc); ^~~~~~~~~~~~~~~~~~~~~ root_device_unregister cc1: some warnings being treated as errors vim +1885 drivers/rtc/rtc-ds1307.c 1631 1632 switch (ds1307->type) { 1633 case ds_1337: 1634 case ds_1339: 1635 case ds_1341: 1636 case ds_3231: 1637 /* get registers that the "rtc" read below won't read... */ 1638 err = regmap_bulk_read(ds1307->regmap, DS1337_REG_CONTROL, 1639 regs, 2); 1640 if (err) { 1641 dev_dbg(ds1307->dev, "read error %d\n", err); 1642 goto exit; 1643 } 1644 1645 /* oscillator off? turn it on, so clock can tick. */ 1646 if (regs[0] & DS1337_BIT_nEOSC) 1647 regs[0] &= ~DS1337_BIT_nEOSC; 1648 1649 /* 1650 * Using IRQ or defined as wakeup-source? 1651 * Disable the square wave and both alarms. 1652 * For some variants, be sure alarms can trigger when we're 1653 * running on Vbackup (BBSQI/BBSQW) 1654 */ 1655 if (want_irq || ds1307_can_wakeup_device) { 1656 regs[0] |= DS1337_BIT_INTCN | chip->bbsqi_bit; 1657 regs[0] &= ~(DS1337_BIT_A2IE | DS1337_BIT_A1IE); 1658 } 1659 1660 regmap_write(ds1307->regmap, DS1337_REG_CONTROL, 1661 regs[0]); 1662 1663 /* oscillator fault? clear flag, and warn */ 1664 if (regs[1] & DS1337_BIT_OSF) { 1665 regmap_write(ds1307->regmap, DS1337_REG_STATUS, 1666 regs[1] & ~DS1337_BIT_OSF); 1667 dev_warn(ds1307->dev, "SET TIME!\n"); 1668 } 1669 break; 1670 1671 case rx_8025: 1672 err = regmap_bulk_read(ds1307->regmap, 1673 RX8025_REG_CTRL1 << 4 | 0x08, regs, 2); 1674 if (err) { 1675 dev_dbg(ds1307->dev, "read error %d\n", err); 1676 goto exit; 1677 } 1678 1679 /* oscillator off? turn it on, so clock can tick. */ 1680 if (!(regs[1] & RX8025_BIT_XST)) { 1681 regs[1] |= RX8025_BIT_XST; 1682 regmap_write(ds1307->regmap, 1683 RX8025_REG_CTRL2 << 4 | 0x08, 1684 regs[1]); 1685 dev_warn(ds1307->dev, 1686 "oscillator stop detected - SET TIME!\n"); 1687 } 1688 1689 if (regs[1] & RX8025_BIT_PON) { 1690 regs[1] &= ~RX8025_BIT_PON; 1691 regmap_write(ds1307->regmap, 1692 RX8025_REG_CTRL2 << 4 | 0x08, 1693 regs[1]); 1694 dev_warn(ds1307->dev, "power-on detected\n"); 1695 } 1696 1697 if (regs[1] & RX8025_BIT_VDET) { 1698 regs[1] &= ~RX8025_BIT_VDET; 1699 regmap_write(ds1307->regmap, 1700 RX8025_REG_CTRL2 << 4 | 0x08, 1701 regs[1]); 1702 dev_warn(ds1307->dev, "voltage drop detected\n"); 1703 } 1704 1705 /* make sure we are running in 24hour mode */ 1706 if (!(regs[0] & RX8025_BIT_2412)) { 1707 u8 hour; 1708 1709 /* switch to 24 hour mode */ 1710 regmap_write(ds1307->regmap, 1711 RX8025_REG_CTRL1 << 4 | 0x08, 1712 regs[0] | RX8025_BIT_2412); 1713 1714 err = regmap_bulk_read(ds1307->regmap, 1715 RX8025_REG_CTRL1 << 4 | 0x08, 1716 regs, 2); 1717 if (err) { 1718 dev_dbg(ds1307->dev, "read error %d\n", err); 1719 goto exit; 1720 } 1721 1722 /* correct hour */ 1723 hour = bcd2bin(regs[DS1307_REG_HOUR]); 1724 if (hour == 12) 1725 hour = 0; 1726 if (regs[DS1307_REG_HOUR] & DS1307_BIT_PM) 1727 hour += 12; 1728 1729 regmap_write(ds1307->regmap, 1730 DS1307_REG_HOUR << 4 | 0x08, hour); 1731 } 1732 break; 1733 default: 1734 break; 1735 } 1736 1737 read_rtc: 1738 /* read RTC registers */ 1739 err = regmap_bulk_read(ds1307->regmap, chip->offset, regs, 1740 sizeof(regs)); 1741 if (err) { 1742 dev_dbg(ds1307->dev, "read error %d\n", err); 1743 goto exit; 1744 } 1745 1746 /* 1747 * minimal sanity checking; some chips (like DS1340) don't 1748 * specify the extra bits as must-be-zero, but there are 1749 * still a few values that are clearly out-of-range. 1750 */ 1751 tmp = regs[DS1307_REG_SECS]; 1752 switch (ds1307->type) { 1753 case ds_1307: 1754 case m41t0: 1755 case m41t00: 1756 case m41t11: 1757 /* clock halted? turn it on, so clock can tick. */ 1758 if (tmp & DS1307_BIT_CH) { 1759 regmap_write(ds1307->regmap, DS1307_REG_SECS, 0); 1760 dev_warn(ds1307->dev, "SET TIME!\n"); 1761 goto read_rtc; 1762 } 1763 break; 1764 case ds_1308: 1765 case ds_1338: 1766 /* clock halted? turn it on, so clock can tick. */ 1767 if (tmp & DS1307_BIT_CH) 1768 regmap_write(ds1307->regmap, DS1307_REG_SECS, 0); 1769 1770 /* oscillator fault? clear flag, and warn */ 1771 if (regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) { 1772 regmap_write(ds1307->regmap, DS1307_REG_CONTROL, 1773 regs[DS1307_REG_CONTROL] & 1774 ~DS1338_BIT_OSF); 1775 dev_warn(ds1307->dev, "SET TIME!\n"); 1776 goto read_rtc; 1777 } 1778 break; 1779 case ds_1340: 1780 /* clock halted? turn it on, so clock can tick. */ 1781 if (tmp & DS1340_BIT_nEOSC) 1782 regmap_write(ds1307->regmap, DS1307_REG_SECS, 0); 1783 1784 err = regmap_read(ds1307->regmap, DS1340_REG_FLAG, &tmp); 1785 if (err) { 1786 dev_dbg(ds1307->dev, "read error %d\n", err); 1787 goto exit; 1788 } 1789 1790 /* oscillator fault? clear flag, and warn */ 1791 if (tmp & DS1340_BIT_OSF) { 1792 regmap_write(ds1307->regmap, DS1340_REG_FLAG, 0); 1793 dev_warn(ds1307->dev, "SET TIME!\n"); 1794 } 1795 break; 1796 case mcp794xx: 1797 /* make sure that the backup battery is enabled */ 1798 if (!(regs[DS1307_REG_WDAY] & MCP794XX_BIT_VBATEN)) { 1799 regmap_write(ds1307->regmap, DS1307_REG_WDAY, 1800 regs[DS1307_REG_WDAY] | 1801 MCP794XX_BIT_VBATEN); 1802 } 1803 1804 /* clock halted? turn it on, so clock can tick. */ 1805 if (!(tmp & MCP794XX_BIT_ST)) { 1806 regmap_write(ds1307->regmap, DS1307_REG_SECS, 1807 MCP794XX_BIT_ST); 1808 dev_warn(ds1307->dev, "SET TIME!\n"); 1809 goto read_rtc; 1810 } 1811 1812 break; 1813 default: 1814 break; 1815 } 1816 1817 tmp = regs[DS1307_REG_HOUR]; 1818 switch (ds1307->type) { 1819 case ds_1340: 1820 case m41t0: 1821 case m41t00: 1822 case m41t11: 1823 /* 1824 * NOTE: ignores century bits; fix before deploying 1825 * systems that will run through year 2100. 1826 */ 1827 break; 1828 case rx_8025: 1829 break; 1830 default: 1831 if (!(tmp & DS1307_BIT_12HR)) 1832 break; 1833 1834 /* 1835 * Be sure we're in 24 hour mode. Multi-master systems 1836 * take note... 1837 */ 1838 tmp = bcd2bin(tmp & 0x1f); 1839 if (tmp == 12) 1840 tmp = 0; 1841 if (regs[DS1307_REG_HOUR] & DS1307_BIT_PM) 1842 tmp += 12; 1843 regmap_write(ds1307->regmap, chip->offset + DS1307_REG_HOUR, 1844 bin2bcd(tmp)); 1845 } 1846 1847 if (want_irq || ds1307_can_wakeup_device) { 1848 device_set_wakeup_capable(ds1307->dev, true); 1849 set_bit(HAS_ALARM, &ds1307->flags); 1850 } 1851 1852 ds1307->rtc = devm_rtc_allocate_device(ds1307->dev); 1853 if (IS_ERR(ds1307->rtc)) 1854 return PTR_ERR(ds1307->rtc); 1855 1856 if (ds1307_can_wakeup_device && !want_irq) { 1857 dev_info(ds1307->dev, 1858 "'wakeup-source' is set, request for an IRQ is disabled!\n"); 1859 /* We cannot support UIE mode if we do not have an IRQ line */ 1860 ds1307->rtc->uie_unsupported = 1; 1861 } 1862 1863 if (want_irq) { 1864 err = devm_request_threaded_irq(ds1307->dev, client->irq, NULL, 1865 chip->irq_handler ?: ds1307_irq, 1866 IRQF_SHARED | IRQF_ONESHOT, 1867 ds1307->name, ds1307); 1868 if (err) { 1869 client->irq = 0; 1870 device_set_wakeup_capable(ds1307->dev, false); 1871 clear_bit(HAS_ALARM, &ds1307->flags); 1872 dev_err(ds1307->dev, "unable to request IRQ!\n"); 1873 } else { 1874 dev_dbg(ds1307->dev, "got IRQ %d\n", client->irq); 1875 } 1876 } 1877 1878 ds1307->rtc->ops = chip->rtc_ops ?: &ds13xx_rtc_ops; 1879 err = rtc_register_device(ds1307->rtc); 1880 if (err) 1881 return err; 1882 1883 err = ds1307_add_frequency_test(ds1307); 1884 if (err) { > 1885 rtc_device_unregister(ds1307->rtc); 1886 return err; 1887 } 1888 1889 if (chip->nvram_size) { 1890 struct nvmem_config nvmem_cfg = { 1891 .name = "ds1307_nvram", 1892 .word_size = 1, 1893 .stride = 1, 1894 .size = chip->nvram_size, 1895 .reg_read = ds1307_nvram_read, 1896 .reg_write = ds1307_nvram_write, 1897 .priv = ds1307, 1898 }; 1899 1900 ds1307->rtc->nvram_old_abi = true; 1901 rtc_nvmem_register(ds1307->rtc, &nvmem_cfg); 1902 } 1903 1904 ds1307_hwmon_register(ds1307); 1905 ds1307_clks_register(ds1307); 1906 1907 return 0; 1908 1909 exit: 1910 return err; 1911 } 1912 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
.config.gz
Description: application/gzip