diff options
Diffstat (limited to 'drivers/hwmon/f71882fg.c')
-rw-r--r-- | drivers/hwmon/f71882fg.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c index 75afb3b0e076..3f49dd376f02 100644 --- a/drivers/hwmon/f71882fg.c +++ b/drivers/hwmon/f71882fg.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 | ***************************************************************************/ | 19 | ***************************************************************************/ |
20 | 20 | ||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
21 | #include <linux/module.h> | 23 | #include <linux/module.h> |
22 | #include <linux/init.h> | 24 | #include <linux/init.h> |
23 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
@@ -865,8 +867,7 @@ static inline int superio_enter(int base) | |||
865 | { | 867 | { |
866 | /* Don't step on other drivers' I/O space by accident */ | 868 | /* Don't step on other drivers' I/O space by accident */ |
867 | if (!request_muxed_region(base, 2, DRVNAME)) { | 869 | if (!request_muxed_region(base, 2, DRVNAME)) { |
868 | printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", | 870 | pr_err("I/O address 0x%04x already in use\n", base); |
869 | base); | ||
870 | return -EBUSY; | 871 | return -EBUSY; |
871 | } | 872 | } |
872 | 873 | ||
@@ -2192,7 +2193,7 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
2192 | 2193 | ||
2193 | devid = superio_inw(sioaddr, SIO_REG_MANID); | 2194 | devid = superio_inw(sioaddr, SIO_REG_MANID); |
2194 | if (devid != SIO_FINTEK_ID) { | 2195 | if (devid != SIO_FINTEK_ID) { |
2195 | pr_debug(DRVNAME ": Not a Fintek device\n"); | 2196 | pr_debug("Not a Fintek device\n"); |
2196 | err = -ENODEV; | 2197 | err = -ENODEV; |
2197 | goto exit; | 2198 | goto exit; |
2198 | } | 2199 | } |
@@ -2215,8 +2216,8 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
2215 | sio_data->type = f8000; | 2216 | sio_data->type = f8000; |
2216 | break; | 2217 | break; |
2217 | default: | 2218 | default: |
2218 | printk(KERN_INFO DRVNAME ": Unsupported Fintek device: %04x\n", | 2219 | pr_info("Unsupported Fintek device: %04x\n", |
2219 | (unsigned int)devid); | 2220 | (unsigned int)devid); |
2220 | err = -ENODEV; | 2221 | err = -ENODEV; |
2221 | goto exit; | 2222 | goto exit; |
2222 | } | 2223 | } |
@@ -2227,21 +2228,21 @@ static int __init f71882fg_find(int sioaddr, unsigned short *address, | |||
2227 | superio_select(sioaddr, SIO_F71882FG_LD_HWM); | 2228 | superio_select(sioaddr, SIO_F71882FG_LD_HWM); |
2228 | 2229 | ||
2229 | if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) { | 2230 | if (!(superio_inb(sioaddr, SIO_REG_ENABLE) & 0x01)) { |
2230 | printk(KERN_WARNING DRVNAME ": Device not activated\n"); | 2231 | pr_warn("Device not activated\n"); |
2231 | err = -ENODEV; | 2232 | err = -ENODEV; |
2232 | goto exit; | 2233 | goto exit; |
2233 | } | 2234 | } |
2234 | 2235 | ||
2235 | *address = superio_inw(sioaddr, SIO_REG_ADDR); | 2236 | *address = superio_inw(sioaddr, SIO_REG_ADDR); |
2236 | if (*address == 0) { | 2237 | if (*address == 0) { |
2237 | printk(KERN_WARNING DRVNAME ": Base address not set\n"); | 2238 | pr_warn("Base address not set\n"); |
2238 | err = -ENODEV; | 2239 | err = -ENODEV; |
2239 | goto exit; | 2240 | goto exit; |
2240 | } | 2241 | } |
2241 | *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ | 2242 | *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ |
2242 | 2243 | ||
2243 | err = 0; | 2244 | err = 0; |
2244 | printk(KERN_INFO DRVNAME ": Found %s chip at %#x, revision %d\n", | 2245 | pr_info("Found %s chip at %#x, revision %d\n", |
2245 | f71882fg_names[sio_data->type], (unsigned int)*address, | 2246 | f71882fg_names[sio_data->type], (unsigned int)*address, |
2246 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); | 2247 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); |
2247 | exit: | 2248 | exit: |
@@ -2270,20 +2271,20 @@ static int __init f71882fg_device_add(unsigned short address, | |||
2270 | 2271 | ||
2271 | err = platform_device_add_resources(f71882fg_pdev, &res, 1); | 2272 | err = platform_device_add_resources(f71882fg_pdev, &res, 1); |
2272 | if (err) { | 2273 | if (err) { |
2273 | printk(KERN_ERR DRVNAME ": Device resource addition failed\n"); | 2274 | pr_err("Device resource addition failed\n"); |
2274 | goto exit_device_put; | 2275 | goto exit_device_put; |
2275 | } | 2276 | } |
2276 | 2277 | ||
2277 | err = platform_device_add_data(f71882fg_pdev, sio_data, | 2278 | err = platform_device_add_data(f71882fg_pdev, sio_data, |
2278 | sizeof(struct f71882fg_sio_data)); | 2279 | sizeof(struct f71882fg_sio_data)); |
2279 | if (err) { | 2280 | if (err) { |
2280 | printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); | 2281 | pr_err("Platform data allocation failed\n"); |
2281 | goto exit_device_put; | 2282 | goto exit_device_put; |
2282 | } | 2283 | } |
2283 | 2284 | ||
2284 | err = platform_device_add(f71882fg_pdev); | 2285 | err = platform_device_add(f71882fg_pdev); |
2285 | if (err) { | 2286 | if (err) { |
2286 | printk(KERN_ERR DRVNAME ": Device addition failed\n"); | 2287 | pr_err("Device addition failed\n"); |
2287 | goto exit_device_put; | 2288 | goto exit_device_put; |
2288 | } | 2289 | } |
2289 | 2290 | ||