Commit 1ca28218eb57143d9ae6298f10c8a193696458a8
Committed by
Jean Delvare
1 parent
5e24e0c365
Exists in
master
and in
40 other branches
hwmon: (w83781d) Use pr_fmt and pr_<level>
Added #define pr_fmt KBUILD_MODNAME ": " fmt Converted printks to pr_<level> Coalesced any long formats Removed prefixes from formats [JD: Optimize repeated debug messages] Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Showing 1 changed file with 14 additions and 15 deletions Side-by-side Diff
drivers/hwmon/w83781d.c
... | ... | @@ -33,6 +33,8 @@ |
33 | 33 | |
34 | 34 | */ |
35 | 35 | |
36 | +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
37 | + | |
36 | 38 | #include <linux/module.h> |
37 | 39 | #include <linux/init.h> |
38 | 40 | #include <linux/slab.h> |
... | ... | @@ -1798,8 +1800,7 @@ |
1798 | 1800 | * individually for the probing phase. */ |
1799 | 1801 | for (port = address; port < address + W83781D_EXTENT; port++) { |
1800 | 1802 | if (!request_region(port, 1, "w83781d")) { |
1801 | - pr_debug("w83781d: Failed to request port 0x%x\n", | |
1802 | - port); | |
1803 | + pr_debug("Failed to request port 0x%x\n", port); | |
1803 | 1804 | goto release; |
1804 | 1805 | } |
1805 | 1806 | } |
... | ... | @@ -1811,7 +1812,7 @@ |
1811 | 1812 | if (inb_p(address + 2) != val |
1812 | 1813 | || inb_p(address + 3) != val |
1813 | 1814 | || inb_p(address + 7) != val) { |
1814 | - pr_debug("w83781d: Detection failed at step 1\n"); | |
1815 | + pr_debug("Detection failed at step %d\n", 1); | |
1815 | 1816 | goto release; |
1816 | 1817 | } |
1817 | 1818 | #undef REALLY_SLOW_IO |
1818 | 1819 | |
... | ... | @@ -1820,14 +1821,14 @@ |
1820 | 1821 | MSB (busy flag) should be clear initially, set after the write. */ |
1821 | 1822 | save = inb_p(address + W83781D_ADDR_REG_OFFSET); |
1822 | 1823 | if (save & 0x80) { |
1823 | - pr_debug("w83781d: Detection failed at step 2\n"); | |
1824 | + pr_debug("Detection failed at step %d\n", 2); | |
1824 | 1825 | goto release; |
1825 | 1826 | } |
1826 | 1827 | val = ~save & 0x7f; |
1827 | 1828 | outb_p(val, address + W83781D_ADDR_REG_OFFSET); |
1828 | 1829 | if (inb_p(address + W83781D_ADDR_REG_OFFSET) != (val | 0x80)) { |
1829 | 1830 | outb_p(save, address + W83781D_ADDR_REG_OFFSET); |
1830 | - pr_debug("w83781d: Detection failed at step 3\n"); | |
1831 | + pr_debug("Detection failed at step %d\n", 3); | |
1831 | 1832 | goto release; |
1832 | 1833 | } |
1833 | 1834 | |
... | ... | @@ -1835,7 +1836,7 @@ |
1835 | 1836 | outb_p(W83781D_REG_CONFIG, address + W83781D_ADDR_REG_OFFSET); |
1836 | 1837 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1837 | 1838 | if (val & 0x80) { |
1838 | - pr_debug("w83781d: Detection failed at step 4\n"); | |
1839 | + pr_debug("Detection failed at step %d\n", 4); | |
1839 | 1840 | goto release; |
1840 | 1841 | } |
1841 | 1842 | outb_p(W83781D_REG_BANK, address + W83781D_ADDR_REG_OFFSET); |
1842 | 1843 | |
1843 | 1844 | |
... | ... | @@ -1844,19 +1845,19 @@ |
1844 | 1845 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1845 | 1846 | if ((!(save & 0x80) && (val != 0xa3)) |
1846 | 1847 | || ((save & 0x80) && (val != 0x5c))) { |
1847 | - pr_debug("w83781d: Detection failed at step 5\n"); | |
1848 | + pr_debug("Detection failed at step %d\n", 5); | |
1848 | 1849 | goto release; |
1849 | 1850 | } |
1850 | 1851 | outb_p(W83781D_REG_I2C_ADDR, address + W83781D_ADDR_REG_OFFSET); |
1851 | 1852 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1852 | 1853 | if (val < 0x03 || val > 0x77) { /* Not a valid I2C address */ |
1853 | - pr_debug("w83781d: Detection failed at step 6\n"); | |
1854 | + pr_debug("Detection failed at step %d\n", 6); | |
1854 | 1855 | goto release; |
1855 | 1856 | } |
1856 | 1857 | |
1857 | 1858 | /* The busy flag should be clear again */ |
1858 | 1859 | if (inb_p(address + W83781D_ADDR_REG_OFFSET) & 0x80) { |
1859 | - pr_debug("w83781d: Detection failed at step 7\n"); | |
1860 | + pr_debug("Detection failed at step %d\n", 7); | |
1860 | 1861 | goto release; |
1861 | 1862 | } |
1862 | 1863 | |
... | ... | @@ -1871,7 +1872,7 @@ |
1871 | 1872 | found = 1; |
1872 | 1873 | |
1873 | 1874 | if (found) |
1874 | - pr_info("w83781d: Found a %s chip at %#x\n", | |
1875 | + pr_info("Found a %s chip at %#x\n", | |
1875 | 1876 | val == 0x30 ? "W83782D" : "W83781D", (int)address); |
1876 | 1877 | |
1877 | 1878 | release: |
1878 | 1879 | |
1879 | 1880 | |
... | ... | @@ -1894,21 +1895,19 @@ |
1894 | 1895 | pdev = platform_device_alloc("w83781d", address); |
1895 | 1896 | if (!pdev) { |
1896 | 1897 | err = -ENOMEM; |
1897 | - printk(KERN_ERR "w83781d: Device allocation failed\n"); | |
1898 | + pr_err("Device allocation failed\n"); | |
1898 | 1899 | goto exit; |
1899 | 1900 | } |
1900 | 1901 | |
1901 | 1902 | err = platform_device_add_resources(pdev, &res, 1); |
1902 | 1903 | if (err) { |
1903 | - printk(KERN_ERR "w83781d: Device resource addition failed " | |
1904 | - "(%d)\n", err); | |
1904 | + pr_err("Device resource addition failed (%d)\n", err); | |
1905 | 1905 | goto exit_device_put; |
1906 | 1906 | } |
1907 | 1907 | |
1908 | 1908 | err = platform_device_add(pdev); |
1909 | 1909 | if (err) { |
1910 | - printk(KERN_ERR "w83781d: Device addition failed (%d)\n", | |
1911 | - err); | |
1910 | + pr_err("Device addition failed (%d)\n", err); | |
1912 | 1911 | goto exit_device_put; |
1913 | 1912 | } |
1914 | 1913 |