aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:06 -0400
commite83ddb335468cdd9ea6e9767eb30b64d8ff176ce (patch)
treeaf7ca0b5be74b713970149efaebe682596523252 /drivers/hwmon
parent14a4fa20a10d76eb98b7feb25be60735217929ba (diff)
parentd0a11693967295772d2a7c22b6b37eb20684e709 (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (40 commits) mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probe mfd: Fix incorrect kfree(i2c) in wm831x-core i2c_driver probe mfd: Fix incorrect kfree(i2c) in tps6507x i2c_driver probe mfd: Add TPS6586x driver mfd: Use macros instead of some constant magic numbers for menelaus mfd: Fix menelaus mmc slot 2 misconfiguration mfd: Missing slab.h includes mfd: Fix wrong wm8350-core kfree in error path mfd: Fix wm8994_device_init() return value mfd: Avoid calling platform_device_put() twice in ucb1400 probe error path mfd: Annotate tc6387xb probe/remove routines with __devinit/__devexit mfd: Fix tc6387xb resource reclaim mfd: Fix wrong goto labels for tc6393xb error handling mfd: Get rid of now unused mc13783 private header hwmon: Don't access struct mc13783 directly from mc13783-adc mfd: New mc13783 function exposing flags mfd: Check jz4740-adc kmalloc() result mfd: Fix jz4740-adc resource reclaim in probe error path mfd: Add WM8321 support mfd: Add stmpe auto sleep feature ...
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/mc13783-adc.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c
index ce3c7bc81814..d5226c9e1201 100644
--- a/drivers/hwmon/mc13783-adc.c
+++ b/drivers/hwmon/mc13783-adc.c
@@ -18,7 +18,7 @@
18 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/mfd/mc13783-private.h> 21#include <linux/mfd/mc13783.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/hwmon-sysfs.h> 23#include <linux/hwmon-sysfs.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -144,6 +144,14 @@ static const struct attribute_group mc13783_group_ts = {
144 .attrs = mc13783_attr_ts, 144 .attrs = mc13783_attr_ts,
145}; 145};
146 146
147static int mc13783_adc_use_touchscreen(struct platform_device *pdev)
148{
149 struct mc13783_adc_priv *priv = platform_get_drvdata(pdev);
150 unsigned flags = mc13783_get_flags(priv->mc13783);
151
152 return flags & MC13783_USE_TOUCHSCREEN;
153}
154
147static int __init mc13783_adc_probe(struct platform_device *pdev) 155static int __init mc13783_adc_probe(struct platform_device *pdev)
148{ 156{
149 struct mc13783_adc_priv *priv; 157 struct mc13783_adc_priv *priv;
@@ -162,10 +170,11 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
162 if (ret) 170 if (ret)
163 goto out_err_create1; 171 goto out_err_create1;
164 172
165 if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN)) 173 if (!mc13783_adc_use_touchscreen(pdev)) {
166 ret = sysfs_create_group(&pdev->dev.kobj, &mc13783_group_ts); 174 ret = sysfs_create_group(&pdev->dev.kobj, &mc13783_group_ts);
167 if (ret) 175 if (ret)
168 goto out_err_create2; 176 goto out_err_create2;
177 }
169 178
170 priv->hwmon_dev = hwmon_device_register(&pdev->dev); 179 priv->hwmon_dev = hwmon_device_register(&pdev->dev);
171 if (IS_ERR(priv->hwmon_dev)) { 180 if (IS_ERR(priv->hwmon_dev)) {
@@ -180,7 +189,7 @@ static int __init mc13783_adc_probe(struct platform_device *pdev)
180 189
181out_err_register: 190out_err_register:
182 191
183 if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN)) 192 if (!mc13783_adc_use_touchscreen(pdev))
184 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts); 193 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
185out_err_create2: 194out_err_create2:
186 195
@@ -199,7 +208,7 @@ static int __devexit mc13783_adc_remove(struct platform_device *pdev)
199 208
200 hwmon_device_unregister(priv->hwmon_dev); 209 hwmon_device_unregister(priv->hwmon_dev);
201 210
202 if (!(priv->mc13783->flags & MC13783_USE_TOUCHSCREEN)) 211 if (!mc13783_adc_use_touchscreen(pdev))
203 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts); 212 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group_ts);
204 213
205 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group); 214 sysfs_remove_group(&pdev->dev.kobj, &mc13783_group);