aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:34:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:35:13 -0500
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /drivers/mfd
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ...
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/ucb1x00-assabet.c17
-rw-r--r--drivers/mfd/ucb1x00-core.c14
-rw-r--r--drivers/mfd/ucb1x00.h4
3 files changed, 18 insertions, 17 deletions
diff --git a/drivers/mfd/ucb1x00-assabet.c b/drivers/mfd/ucb1x00-assabet.c
index e325fa71f38b..b7c8e7813865 100644
--- a/drivers/mfd/ucb1x00-assabet.c
+++ b/drivers/mfd/ucb1x00-assabet.c
@@ -20,7 +20,8 @@
20#include "ucb1x00.h" 20#include "ucb1x00.h"
21 21
22#define UCB1X00_ATTR(name,input)\ 22#define UCB1X00_ATTR(name,input)\
23static ssize_t name##_show(struct class_device *dev, char *buf) \ 23static ssize_t name##_show(struct device *dev, struct device_attribute *attr,
24 char *buf) \
24{ \ 25{ \
25 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev); \ 26 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev); \
26 int val; \ 27 int val; \
@@ -29,7 +30,7 @@ static ssize_t name##_show(struct class_device *dev, char *buf) \
29 ucb1x00_adc_disable(ucb); \ 30 ucb1x00_adc_disable(ucb); \
30 return sprintf(buf, "%d\n", val); \ 31 return sprintf(buf, "%d\n", val); \
31} \ 32} \
32static CLASS_DEVICE_ATTR(name,0444,name##_show,NULL) 33static DEVICE_ATTR(name,0444,name##_show,NULL)
33 34
34UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1); 35UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1);
35UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0); 36UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0);
@@ -37,17 +38,17 @@ UCB1X00_ATTR(batt_temp, UCB_ADC_INP_AD2);
37 38
38static int ucb1x00_assabet_add(struct ucb1x00_dev *dev) 39static int ucb1x00_assabet_add(struct ucb1x00_dev *dev)
39{ 40{
40 class_device_create_file(&dev->ucb->cdev, &class_device_attr_vbatt); 41 device_create_file(&dev->ucb->dev, &device_attr_vbatt);
41 class_device_create_file(&dev->ucb->cdev, &class_device_attr_vcharger); 42 device_create_file(&dev->ucb->dev, &device_attr_vcharger);
42 class_device_create_file(&dev->ucb->cdev, &class_device_attr_batt_temp); 43 device_create_file(&dev->ucb->dev, &device_attr_batt_temp);
43 return 0; 44 return 0;
44} 45}
45 46
46static void ucb1x00_assabet_remove(struct ucb1x00_dev *dev) 47static void ucb1x00_assabet_remove(struct ucb1x00_dev *dev)
47{ 48{
48 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_batt_temp); 49 device_remove_file(&dev->ucb->cdev, &device_attr_batt_temp);
49 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_vcharger); 50 device_remove_file(&dev->ucb->cdev, &device_attr_vcharger);
50 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_vbatt); 51 device_remove_file(&dev->ucb->cdev, &device_attr_vbatt);
51} 52}
52 53
53static struct ucb1x00_driver ucb1x00_assabet_driver = { 54static struct ucb1x00_driver ucb1x00_assabet_driver = {
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index e03f1bcd4f9f..f6b10dda31fd 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -458,7 +458,7 @@ static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
458 return probe_irq_off(mask); 458 return probe_irq_off(mask);
459} 459}
460 460
461static void ucb1x00_release(struct class_device *dev) 461static void ucb1x00_release(struct device *dev)
462{ 462{
463 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev); 463 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev);
464 kfree(ucb); 464 kfree(ucb);
@@ -466,7 +466,7 @@ static void ucb1x00_release(struct class_device *dev)
466 466
467static struct class ucb1x00_class = { 467static struct class ucb1x00_class = {
468 .name = "ucb1x00", 468 .name = "ucb1x00",
469 .release = ucb1x00_release, 469 .dev_release = ucb1x00_release,
470}; 470};
471 471
472static int ucb1x00_probe(struct mcp *mcp) 472static int ucb1x00_probe(struct mcp *mcp)
@@ -490,9 +490,9 @@ static int ucb1x00_probe(struct mcp *mcp)
490 goto err_disable; 490 goto err_disable;
491 491
492 492
493 ucb->cdev.class = &ucb1x00_class; 493 ucb->dev.class = &ucb1x00_class;
494 ucb->cdev.dev = &mcp->attached_device; 494 ucb->dev.parent = &mcp->attached_device;
495 strlcpy(ucb->cdev.class_id, "ucb1x00", sizeof(ucb->cdev.class_id)); 495 strlcpy(ucb->dev.bus_id, "ucb1x00", sizeof(ucb->dev.bus_id));
496 496
497 spin_lock_init(&ucb->lock); 497 spin_lock_init(&ucb->lock);
498 spin_lock_init(&ucb->io_lock); 498 spin_lock_init(&ucb->io_lock);
@@ -517,7 +517,7 @@ static int ucb1x00_probe(struct mcp *mcp)
517 517
518 mcp_set_drvdata(mcp, ucb); 518 mcp_set_drvdata(mcp, ucb);
519 519
520 ret = class_device_register(&ucb->cdev); 520 ret = device_register(&ucb->dev);
521 if (ret) 521 if (ret)
522 goto err_irq; 522 goto err_irq;
523 523
@@ -554,7 +554,7 @@ static void ucb1x00_remove(struct mcp *mcp)
554 mutex_unlock(&ucb1x00_mutex); 554 mutex_unlock(&ucb1x00_mutex);
555 555
556 free_irq(ucb->irq, ucb); 556 free_irq(ucb->irq, ucb);
557 class_device_unregister(&ucb->cdev); 557 device_unregister(&ucb->dev);
558} 558}
559 559
560int ucb1x00_register_driver(struct ucb1x00_driver *drv) 560int ucb1x00_register_driver(struct ucb1x00_driver *drv)
diff --git a/drivers/mfd/ucb1x00.h b/drivers/mfd/ucb1x00.h
index ca8df8072d43..a8ad8a0ed5db 100644
--- a/drivers/mfd/ucb1x00.h
+++ b/drivers/mfd/ucb1x00.h
@@ -120,7 +120,7 @@ struct ucb1x00 {
120 u16 irq_fal_enbl; 120 u16 irq_fal_enbl;
121 u16 irq_ris_enbl; 121 u16 irq_ris_enbl;
122 struct ucb1x00_irq irq_handler[16]; 122 struct ucb1x00_irq irq_handler[16];
123 struct class_device cdev; 123 struct device dev;
124 struct list_head node; 124 struct list_head node;
125 struct list_head devs; 125 struct list_head devs;
126}; 126};
@@ -144,7 +144,7 @@ struct ucb1x00_driver {
144 int (*resume)(struct ucb1x00_dev *dev); 144 int (*resume)(struct ucb1x00_dev *dev);
145}; 145};
146 146
147#define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, cdev) 147#define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, dev)
148 148
149int ucb1x00_register_driver(struct ucb1x00_driver *); 149int ucb1x00_register_driver(struct ucb1x00_driver *);
150void ucb1x00_unregister_driver(struct ucb1x00_driver *); 150void ucb1x00_unregister_driver(struct ucb1x00_driver *);