projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[SCSI] scsi_debug: support REPORT TARGET PORT GROUPS
[powerpc.git]
/
drivers
/
mfd
/
ucb1x00-core.c
diff --git
a/drivers/mfd/ucb1x00-core.c
b/drivers/mfd/ucb1x00-core.c
index
b42e0fb
..
149810a
100644
(file)
--- a/
drivers/mfd/ucb1x00-core.c
+++ b/
drivers/mfd/ucb1x00-core.c
@@
-16,7
+16,6
@@
* Note that all locks are private to this file. Nothing else may
* touch them.
*/
* Note that all locks are private to this file. Nothing else may
* touch them.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@@
-24,13
+23,14
@@
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/device.h>
+#include <linux/mutex.h>
#include <asm/dma.h>
#include <asm/hardware.h>
#include "ucb1x00.h"
#include <asm/dma.h>
#include <asm/hardware.h>
#include "ucb1x00.h"
-static DE
CLARE_MUTEX(ucb1x00_sem
);
+static DE
FINE_MUTEX(ucb1x00_mutex
);
static LIST_HEAD(ucb1x00_drivers);
static LIST_HEAD(ucb1x00_devices);
static LIST_HEAD(ucb1x00_drivers);
static LIST_HEAD(ucb1x00_devices);
@@
-203,7
+203,7
@@
void ucb1x00_adc_disable(struct ucb1x00 *ucb)
* SIBCLK to talk to the chip. We leave the clock running until
* we have finished processing all interrupts from the chip.
*/
* SIBCLK to talk to the chip. We leave the clock running until
* we have finished processing all interrupts from the chip.
*/
-static irqreturn_t ucb1x00_irq(int irqnr, void *devid
, struct pt_regs *regs
)
+static irqreturn_t ucb1x00_irq(int irqnr, void *devid)
{
struct ucb1x00 *ucb = devid;
struct ucb1x00_irq *irq;
{
struct ucb1x00 *ucb = devid;
struct ucb1x00_irq *irq;
@@
-419,8
+419,10
@@
static int ucb1x00_detect_irq(struct ucb1x00 *ucb)
unsigned long mask;
mask = probe_irq_on();
unsigned long mask;
mask = probe_irq_on();
- if (!mask)
+ if (!mask) {
+ probe_irq_off(mask);
return NO_IRQ;
return NO_IRQ;
+ }
/*
* Enable the ADC interrupt.
/*
* Enable the ADC interrupt.
@@
-477,7
+479,7
@@
static int ucb1x00_probe(struct mcp *mcp)
mcp_enable(mcp);
id = mcp_reg_read(mcp, UCB_ID);
mcp_enable(mcp);
id = mcp_reg_read(mcp, UCB_ID);
- if (id != UCB_ID_1200 && id != UCB_ID_1300) {
+ if (id != UCB_ID_1200 && id != UCB_ID_1300
&& id != UCB_ID_TC35143
) {
printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
goto err_disable;
}
printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
goto err_disable;
}
@@
-506,7
+508,7
@@
static int ucb1x00_probe(struct mcp *mcp)
goto err_free;
}
goto err_free;
}
- ret = request_irq(ucb->irq, ucb1x00_irq,
SA
_TRIGGER_RISING,
+ ret = request_irq(ucb->irq, ucb1x00_irq,
IRQF
_TRIGGER_RISING,
"UCB1x00", ucb);
if (ret) {
printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
"UCB1x00", ucb);
if (ret) {
printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
@@
-521,12
+523,12
@@
static int ucb1x00_probe(struct mcp *mcp)
goto err_irq;
INIT_LIST_HEAD(&ucb->devs);
goto err_irq;
INIT_LIST_HEAD(&ucb->devs);
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_add(&ucb->node, &ucb1x00_devices);
list_for_each_entry(drv, &ucb1x00_drivers, node) {
ucb1x00_add_dev(ucb, drv);
}
list_add(&ucb->node, &ucb1x00_devices);
list_for_each_entry(drv, &ucb1x00_drivers, node) {
ucb1x00_add_dev(ucb, drv);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
goto out;
err_irq:
goto out;
err_irq:
@@
-544,13
+546,13
@@
static void ucb1x00_remove(struct mcp *mcp)
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct list_head *l, *n;
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct list_head *l, *n;
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_del(&ucb->node);
list_for_each_safe(l, n, &ucb->devs) {
struct ucb1x00_dev *dev = list_entry(l, struct ucb1x00_dev, dev_node);
ucb1x00_remove_dev(dev);
}
list_del(&ucb->node);
list_for_each_safe(l, n, &ucb->devs) {
struct ucb1x00_dev *dev = list_entry(l, struct ucb1x00_dev, dev_node);
ucb1x00_remove_dev(dev);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
free_irq(ucb->irq, ucb);
class_device_unregister(&ucb->cdev);
free_irq(ucb->irq, ucb);
class_device_unregister(&ucb->cdev);
@@
-561,12
+563,12
@@
int ucb1x00_register_driver(struct ucb1x00_driver *drv)
struct ucb1x00 *ucb;
INIT_LIST_HEAD(&drv->devs);
struct ucb1x00 *ucb;
INIT_LIST_HEAD(&drv->devs);
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_add(&drv->node, &ucb1x00_drivers);
list_for_each_entry(ucb, &ucb1x00_devices, node) {
ucb1x00_add_dev(ucb, drv);
}
list_add(&drv->node, &ucb1x00_drivers);
list_for_each_entry(ucb, &ucb1x00_devices, node) {
ucb1x00_add_dev(ucb, drv);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
return 0;
}
return 0;
}
@@
-574,13
+576,13
@@
void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
{
struct list_head *n, *l;
{
struct list_head *n, *l;
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_del(&drv->node);
list_for_each_safe(l, n, &drv->devs) {
struct ucb1x00_dev *dev = list_entry(l, struct ucb1x00_dev, drv_node);
ucb1x00_remove_dev(dev);
}
list_del(&drv->node);
list_for_each_safe(l, n, &drv->devs) {
struct ucb1x00_dev *dev = list_entry(l, struct ucb1x00_dev, drv_node);
ucb1x00_remove_dev(dev);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
}
static int ucb1x00_suspend(struct mcp *mcp, pm_message_t state)
}
static int ucb1x00_suspend(struct mcp *mcp, pm_message_t state)
@@
-588,12
+590,12
@@
static int ucb1x00_suspend(struct mcp *mcp, pm_message_t state)
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct ucb1x00_dev *dev;
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct ucb1x00_dev *dev;
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_for_each_entry(dev, &ucb->devs, dev_node) {
if (dev->drv->suspend)
dev->drv->suspend(dev, state);
}
list_for_each_entry(dev, &ucb->devs, dev_node) {
if (dev->drv->suspend)
dev->drv->suspend(dev, state);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
return 0;
}
return 0;
}
@@
-602,12
+604,12
@@
static int ucb1x00_resume(struct mcp *mcp)
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct ucb1x00_dev *dev;
struct ucb1x00 *ucb = mcp_get_drvdata(mcp);
struct ucb1x00_dev *dev;
-
down(&ucb1x00_sem
);
+
mutex_lock(&ucb1x00_mutex
);
list_for_each_entry(dev, &ucb->devs, dev_node) {
if (dev->drv->resume)
dev->drv->resume(dev);
}
list_for_each_entry(dev, &ucb->devs, dev_node) {
if (dev->drv->resume)
dev->drv->resume(dev);
}
-
up(&ucb1x00_sem
);
+
mutex_unlock(&ucb1x00_mutex
);
return 0;
}
return 0;
}