aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm70.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/hwmon/lm70.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/hwmon/lm70.c')
-rw-r--r--drivers/hwmon/lm70.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c
index fd108cfc05c7..c274ea25d899 100644
--- a/drivers/hwmon/lm70.c
+++ b/drivers/hwmon/lm70.c
@@ -24,6 +24,8 @@
24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 25 */
26 26
27#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28
27#include <linux/init.h> 29#include <linux/init.h>
28#include <linux/module.h> 30#include <linux/module.h>
29#include <linux/kernel.h> 31#include <linux/kernel.h>
@@ -56,7 +58,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
56 int status, val = 0; 58 int status, val = 0;
57 u8 rxbuf[2]; 59 u8 rxbuf[2];
58 s16 raw=0; 60 s16 raw=0;
59 struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev); 61 struct lm70 *p_lm70 = spi_get_drvdata(spi);
60 62
61 if (mutex_lock_interruptible(&p_lm70->lock)) 63 if (mutex_lock_interruptible(&p_lm70->lock))
62 return -ERESTARTSYS; 64 return -ERESTARTSYS;
@@ -67,8 +69,7 @@ static ssize_t lm70_sense_temp(struct device *dev,
67 */ 69 */
68 status = spi_write_then_read(spi, NULL, 0, &rxbuf[0], 2); 70 status = spi_write_then_read(spi, NULL, 0, &rxbuf[0], 2);
69 if (status < 0) { 71 if (status < 0) {
70 printk(KERN_WARNING 72 pr_warn("spi_write_then_read failed with status %d\n", status);
71 "spi_write_then_read failed with status %d\n", status);
72 goto out; 73 goto out;
73 } 74 }
74 raw = (rxbuf[0] << 8) + rxbuf[1]; 75 raw = (rxbuf[0] << 8) + rxbuf[1];
@@ -162,7 +163,7 @@ static int __devinit lm70_probe(struct spi_device *spi)
162 status = PTR_ERR(p_lm70->hwmon_dev); 163 status = PTR_ERR(p_lm70->hwmon_dev);
163 goto out_dev_reg_failed; 164 goto out_dev_reg_failed;
164 } 165 }
165 dev_set_drvdata(&spi->dev, p_lm70); 166 spi_set_drvdata(spi, p_lm70);
166 167
167 if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input)) 168 if ((status = device_create_file(&spi->dev, &dev_attr_temp1_input))
168 || (status = device_create_file(&spi->dev, &dev_attr_name))) { 169 || (status = device_create_file(&spi->dev, &dev_attr_name))) {
@@ -176,19 +177,19 @@ out_dev_create_file_failed:
176 device_remove_file(&spi->dev, &dev_attr_temp1_input); 177 device_remove_file(&spi->dev, &dev_attr_temp1_input);
177 hwmon_device_unregister(p_lm70->hwmon_dev); 178 hwmon_device_unregister(p_lm70->hwmon_dev);
178out_dev_reg_failed: 179out_dev_reg_failed:
179 dev_set_drvdata(&spi->dev, NULL); 180 spi_set_drvdata(spi, NULL);
180 kfree(p_lm70); 181 kfree(p_lm70);
181 return status; 182 return status;
182} 183}
183 184
184static int __devexit lm70_remove(struct spi_device *spi) 185static int __devexit lm70_remove(struct spi_device *spi)
185{ 186{
186 struct lm70 *p_lm70 = dev_get_drvdata(&spi->dev); 187 struct lm70 *p_lm70 = spi_get_drvdata(spi);
187 188
188 device_remove_file(&spi->dev, &dev_attr_temp1_input); 189 device_remove_file(&spi->dev, &dev_attr_temp1_input);
189 device_remove_file(&spi->dev, &dev_attr_name); 190 device_remove_file(&spi->dev, &dev_attr_name);
190 hwmon_device_unregister(p_lm70->hwmon_dev); 191 hwmon_device_unregister(p_lm70->hwmon_dev);
191 dev_set_drvdata(&spi->dev, NULL); 192 spi_set_drvdata(spi, NULL);
192 kfree(p_lm70); 193 kfree(p_lm70);
193 194
194 return 0; 195 return 0;