projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
leds: Standardise LED naming scheme
[powerpc.git]
/
drivers
/
hwmon
/
hwmon.c
diff --git
a/drivers/hwmon/hwmon.c
b/drivers/hwmon/hwmon.c
index
106fa01
..
3db2845
100644
(file)
--- a/
drivers/hwmon/hwmon.c
+++ b/
drivers/hwmon/hwmon.c
@@
-28,17
+28,17
@@
static DEFINE_IDR(hwmon_idr);
static DEFINE_SPINLOCK(idr_lock);
/**
static DEFINE_SPINLOCK(idr_lock);
/**
- * hwmon_device_register - register w/ hwmon
sysfs class
+ * hwmon_device_register - register w/ hwmon
* @dev: the device to register
*
* @dev: the device to register
*
- * hwmon_device_unregister() must be called when the
class
device is no
+ * hwmon_device_unregister() must be called when the device is no
* longer needed.
*
* longer needed.
*
- * Returns the pointer to the new
struct class
device.
+ * Returns the pointer to the new device.
*/
*/
-struct
class_
device *hwmon_device_register(struct device *dev)
+struct device *hwmon_device_register(struct device *dev)
{
{
- struct
class_device *c
dev;
+ struct
device *hw
dev;
int id, err;
again:
int id, err;
again:
@@
-55,34
+55,33
@@
again:
return ERR_PTR(err);
id = id & MAX_ID_MASK;
return ERR_PTR(err);
id = id & MAX_ID_MASK;
- cdev = class_device_create(hwmon_class, NULL, MKDEV(0,0), dev,
- HWMON_ID_FORMAT, id);
+ hwdev = device_create(hwmon_class, dev, MKDEV(0,0), HWMON_ID_FORMAT, id);
- if (IS_ERR(
c
dev)) {
+ if (IS_ERR(
hw
dev)) {
spin_lock(&idr_lock);
idr_remove(&hwmon_idr, id);
spin_unlock(&idr_lock);
}
spin_lock(&idr_lock);
idr_remove(&hwmon_idr, id);
spin_unlock(&idr_lock);
}
- return
c
dev;
+ return
hw
dev;
}
/**
* hwmon_device_unregister - removes the previously registered class device
*
}
/**
* hwmon_device_unregister - removes the previously registered class device
*
- * @
c
dev: the class device to destroy
+ * @dev: the class device to destroy
*/
*/
-void hwmon_device_unregister(struct
class_device *c
dev)
+void hwmon_device_unregister(struct
device *
dev)
{
int id;
{
int id;
- if (likely(sscanf(
cdev->clas
s_id, HWMON_ID_FORMAT, &id) == 1)) {
-
class_device_unregister(c
dev);
+ if (likely(sscanf(
dev->bu
s_id, HWMON_ID_FORMAT, &id) == 1)) {
+
device_unregister(
dev);
spin_lock(&idr_lock);
idr_remove(&hwmon_idr, id);
spin_unlock(&idr_lock);
} else
spin_lock(&idr_lock);
idr_remove(&hwmon_idr, id);
spin_unlock(&idr_lock);
} else
- dev_dbg(
cdev->dev
,
+ dev_dbg(
dev->parent
,
"hwmon_device_unregister() failed: bad class ID!\n");
}
"hwmon_device_unregister() failed: bad class ID!\n");
}
@@
-101,7
+100,7
@@
static void __exit hwmon_exit(void)
class_destroy(hwmon_class);
}
class_destroy(hwmon_class);
}
-
module_init
(hwmon_init);
+
subsys_initcall
(hwmon_init);
module_exit(hwmon_exit);
EXPORT_SYMBOL_GPL(hwmon_device_register);
module_exit(hwmon_exit);
EXPORT_SYMBOL_GPL(hwmon_device_register);