diff options
Diffstat (limited to 'drivers/hwmon/pc87427.c')
| -rw-r--r-- | drivers/hwmon/pc87427.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/hwmon/pc87427.c b/drivers/hwmon/pc87427.c index f185b1fa53e..9e4684e747e 100644 --- a/drivers/hwmon/pc87427.c +++ b/drivers/hwmon/pc87427.c @@ -1,7 +1,7 @@ /* * pc87427.c - hardware monitoring driver for the * National Semiconductor PC87427 Super-I/O chip - * Copyright (C) 2006, 2008, 2010 Jean Delvare <khali@linux-fr.org> + * Copyright (C) 2006, 2008, 2010 Jean Delvare <jdelvare@suse.de> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -627,8 +627,9 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute pc87427_readall_pwm(data, nr); mode = data->pwm_enable[nr] & PWM_ENABLE_MODE_MASK; if (mode != PWM_MODE_MANUAL && mode != PWM_MODE_OFF) { - dev_notice(dev, "Can't set PWM%d duty cycle while not in " - "manual mode\n", nr + 1); + dev_notice(dev, + "Can't set PWM%d duty cycle while not in manual mode\n", + nr + 1); mutex_unlock(&data->lock); return -EPERM; } @@ -956,7 +957,7 @@ static DEVICE_ATTR(name, S_IRUGO, show_name, NULL); * Device detection, attach and detach */ -static int __devinit pc87427_request_regions(struct platform_device *pdev, +static int pc87427_request_regions(struct platform_device *pdev, int count) { struct resource *res; @@ -980,9 +981,9 @@ static int __devinit pc87427_request_regions(struct platform_device *pdev, return 0; } -static void __devinit pc87427_init_device(struct device *dev) +static void pc87427_init_device(struct device *dev) { - struct pc87427_sio_data *sio_data = dev->platform_data; + struct pc87427_sio_data *sio_data = dev_get_platdata(dev); struct pc87427_data *data = dev_get_drvdata(dev); int i; u8 reg; @@ -1072,18 +1073,16 @@ static void pc87427_remove_files(struct device *dev) } } -static int __devinit pc87427_probe(struct platform_device *pdev) +static int pc87427_probe(struct platform_device *pdev) { - struct pc87427_sio_data *sio_data = pdev->dev.platform_data; + struct pc87427_sio_data *sio_data = dev_get_platdata(&pdev->dev); struct pc87427_data *data; int i, err, res_count; data = devm_kzalloc(&pdev->dev, sizeof(struct pc87427_data), GFP_KERNEL); - if (!data) { - pr_err("Out of memory\n"); + if (!data) return -ENOMEM; - } data->address[0] = sio_data->address[0]; data->address[1] = sio_data->address[1]; @@ -1141,7 +1140,7 @@ exit_remove_files: return err; } -static int __devexit pc87427_remove(struct platform_device *pdev) +static int pc87427_remove(struct platform_device *pdev) { struct pc87427_data *data = platform_get_drvdata(pdev); @@ -1158,7 +1157,7 @@ static struct platform_driver pc87427_driver = { .name = DRVNAME, }, .probe = pc87427_probe, - .remove = __devexit_p(pc87427_remove), + .remove = pc87427_remove, }; static int __init pc87427_device_add(const struct pc87427_sio_data *sio_data) @@ -1245,16 +1244,16 @@ static int __init pc87427_find(int sioaddr, struct pc87427_sio_data *sio_data) val = superio_inb(sioaddr, SIOREG_MAP); if (val & 0x01) { - pr_warn("Logical device 0x%02x is memory-mapped, " - "can't use\n", logdev[i]); + pr_warn("Logical device 0x%02x is memory-mapped, can't use\n", + logdev[i]); continue; } val = (superio_inb(sioaddr, SIOREG_IOBASE) << 8) | superio_inb(sioaddr, SIOREG_IOBASE + 1); if (!val) { - pr_info("I/O base address not set for logical device " - "0x%02x\n", logdev[i]); + pr_info("I/O base address not set for logical device 0x%02x\n", + logdev[i]); continue; } sio_data->address[i] = val; @@ -1346,7 +1345,7 @@ static void __exit pc87427_exit(void) platform_driver_unregister(&pc87427_driver); } -MODULE_AUTHOR("Jean Delvare <khali@linux-fr.org>"); +MODULE_AUTHOR("Jean Delvare <jdelvare@suse.de>"); MODULE_DESCRIPTION("PC87427 hardware monitoring driver"); MODULE_LICENSE("GPL"); |
