diff options
author | Joe Perches <joe@perches.com> | 2011-01-12 15:55:11 -0500 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-01-12 15:55:11 -0500 |
commit | 1ca28218eb57143d9ae6298f10c8a193696458a8 (patch) | |
tree | 3fa9dca8c4ae539402c390f5d72c2f511c78821c /drivers/hwmon | |
parent | 5e24e0c365e0f83f9a6f5adb3bd0cf5ca5cd8ab1 (diff) |
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/w83781d.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index c84b9b4e6960..eed43a008be1 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | */ | 34 | */ |
35 | 35 | ||
36 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
37 | |||
36 | #include <linux/module.h> | 38 | #include <linux/module.h> |
37 | #include <linux/init.h> | 39 | #include <linux/init.h> |
38 | #include <linux/slab.h> | 40 | #include <linux/slab.h> |
@@ -1798,8 +1800,7 @@ w83781d_isa_found(unsigned short address) | |||
1798 | * individually for the probing phase. */ | 1800 | * individually for the probing phase. */ |
1799 | for (port = address; port < address + W83781D_EXTENT; port++) { | 1801 | for (port = address; port < address + W83781D_EXTENT; port++) { |
1800 | if (!request_region(port, 1, "w83781d")) { | 1802 | if (!request_region(port, 1, "w83781d")) { |
1801 | pr_debug("w83781d: Failed to request port 0x%x\n", | 1803 | pr_debug("Failed to request port 0x%x\n", port); |
1802 | port); | ||
1803 | goto release; | 1804 | goto release; |
1804 | } | 1805 | } |
1805 | } | 1806 | } |
@@ -1811,7 +1812,7 @@ w83781d_isa_found(unsigned short address) | |||
1811 | if (inb_p(address + 2) != val | 1812 | if (inb_p(address + 2) != val |
1812 | || inb_p(address + 3) != val | 1813 | || inb_p(address + 3) != val |
1813 | || inb_p(address + 7) != val) { | 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 | goto release; | 1816 | goto release; |
1816 | } | 1817 | } |
1817 | #undef REALLY_SLOW_IO | 1818 | #undef REALLY_SLOW_IO |
@@ -1820,14 +1821,14 @@ w83781d_isa_found(unsigned short address) | |||
1820 | MSB (busy flag) should be clear initially, set after the write. */ | 1821 | MSB (busy flag) should be clear initially, set after the write. */ |
1821 | save = inb_p(address + W83781D_ADDR_REG_OFFSET); | 1822 | save = inb_p(address + W83781D_ADDR_REG_OFFSET); |
1822 | if (save & 0x80) { | 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 | goto release; | 1825 | goto release; |
1825 | } | 1826 | } |
1826 | val = ~save & 0x7f; | 1827 | val = ~save & 0x7f; |
1827 | outb_p(val, address + W83781D_ADDR_REG_OFFSET); | 1828 | outb_p(val, address + W83781D_ADDR_REG_OFFSET); |
1828 | if (inb_p(address + W83781D_ADDR_REG_OFFSET) != (val | 0x80)) { | 1829 | if (inb_p(address + W83781D_ADDR_REG_OFFSET) != (val | 0x80)) { |
1829 | outb_p(save, address + W83781D_ADDR_REG_OFFSET); | 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 | goto release; | 1832 | goto release; |
1832 | } | 1833 | } |
1833 | 1834 | ||
@@ -1835,7 +1836,7 @@ w83781d_isa_found(unsigned short address) | |||
1835 | outb_p(W83781D_REG_CONFIG, address + W83781D_ADDR_REG_OFFSET); | 1836 | outb_p(W83781D_REG_CONFIG, address + W83781D_ADDR_REG_OFFSET); |
1836 | val = inb_p(address + W83781D_DATA_REG_OFFSET); | 1837 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1837 | if (val & 0x80) { | 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 | goto release; | 1840 | goto release; |
1840 | } | 1841 | } |
1841 | outb_p(W83781D_REG_BANK, address + W83781D_ADDR_REG_OFFSET); | 1842 | outb_p(W83781D_REG_BANK, address + W83781D_ADDR_REG_OFFSET); |
@@ -1844,19 +1845,19 @@ w83781d_isa_found(unsigned short address) | |||
1844 | val = inb_p(address + W83781D_DATA_REG_OFFSET); | 1845 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1845 | if ((!(save & 0x80) && (val != 0xa3)) | 1846 | if ((!(save & 0x80) && (val != 0xa3)) |
1846 | || ((save & 0x80) && (val != 0x5c))) { | 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 | goto release; | 1849 | goto release; |
1849 | } | 1850 | } |
1850 | outb_p(W83781D_REG_I2C_ADDR, address + W83781D_ADDR_REG_OFFSET); | 1851 | outb_p(W83781D_REG_I2C_ADDR, address + W83781D_ADDR_REG_OFFSET); |
1851 | val = inb_p(address + W83781D_DATA_REG_OFFSET); | 1852 | val = inb_p(address + W83781D_DATA_REG_OFFSET); |
1852 | if (val < 0x03 || val > 0x77) { /* Not a valid I2C address */ | 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 | goto release; | 1855 | goto release; |
1855 | } | 1856 | } |
1856 | 1857 | ||
1857 | /* The busy flag should be clear again */ | 1858 | /* The busy flag should be clear again */ |
1858 | if (inb_p(address + W83781D_ADDR_REG_OFFSET) & 0x80) { | 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 | goto release; | 1861 | goto release; |
1861 | } | 1862 | } |
1862 | 1863 | ||
@@ -1871,7 +1872,7 @@ w83781d_isa_found(unsigned short address) | |||
1871 | found = 1; | 1872 | found = 1; |
1872 | 1873 | ||
1873 | if (found) | 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 | val == 0x30 ? "W83782D" : "W83781D", (int)address); | 1876 | val == 0x30 ? "W83782D" : "W83781D", (int)address); |
1876 | 1877 | ||
1877 | release: | 1878 | release: |
@@ -1894,21 +1895,19 @@ w83781d_isa_device_add(unsigned short address) | |||
1894 | pdev = platform_device_alloc("w83781d", address); | 1895 | pdev = platform_device_alloc("w83781d", address); |
1895 | if (!pdev) { | 1896 | if (!pdev) { |
1896 | err = -ENOMEM; | 1897 | err = -ENOMEM; |
1897 | printk(KERN_ERR "w83781d: Device allocation failed\n"); | 1898 | pr_err("Device allocation failed\n"); |
1898 | goto exit; | 1899 | goto exit; |
1899 | } | 1900 | } |
1900 | 1901 | ||
1901 | err = platform_device_add_resources(pdev, &res, 1); | 1902 | err = platform_device_add_resources(pdev, &res, 1); |
1902 | if (err) { | 1903 | if (err) { |
1903 | printk(KERN_ERR "w83781d: Device resource addition failed " | 1904 | pr_err("Device resource addition failed (%d)\n", err); |
1904 | "(%d)\n", err); | ||
1905 | goto exit_device_put; | 1905 | goto exit_device_put; |
1906 | } | 1906 | } |
1907 | 1907 | ||
1908 | err = platform_device_add(pdev); | 1908 | err = platform_device_add(pdev); |
1909 | if (err) { | 1909 | if (err) { |
1910 | printk(KERN_ERR "w83781d: Device addition failed (%d)\n", | 1910 | pr_err("Device addition failed (%d)\n", err); |
1911 | err); | ||
1912 | goto exit_device_put; | 1911 | goto exit_device_put; |
1913 | } | 1912 | } |
1914 | 1913 | ||