Commit d50dbec3 authored by Dominik Brodowski's avatar Dominik Brodowski

pcmcia: use dynamic debug instead of custom infrastructure

Use the generic "dynamic debug" infrastructure instead of
CONIG_PCMCIA_DEBUG in the PCMCIA core (pcmcia.ko and pcmcia_core.ko). To
enable debugging, enable CONFIG_DYNAMIC_DEBUG, mount debugfs and

$ echo -n 'module pcmcia_core +p' > /sys/kernel/debug/dynamic_debug/control

for the complete module "pcmcia_core", for example. For more detailled
instructions, please see Documentation/dynamic-debug-howto.txt
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 18a7a19b
......@@ -91,7 +91,7 @@ static u_int xlate_rom_addr(void __iomem *b, u_int addr)
static void cb_release_cis_mem(struct pcmcia_socket * s)
{
if (s->cb_cis_virt) {
cs_dbg(s, 1, "cb_release_cis_mem()\n");
dev_dbg(&s->dev, "cb_release_cis_mem()\n");
iounmap(s->cb_cis_virt);
s->cb_cis_virt = NULL;
s->cb_cis_res = NULL;
......@@ -132,7 +132,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
struct pci_dev *dev;
struct resource *res;
cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len);
dev_dbg(&s->dev, "read_cb_mem(%d, %#x, %u)\n", space, addr, len);
dev = pci_get_slot(s->cb_dev->subordinate, 0);
if (!dev)
......
......@@ -138,7 +138,7 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
void __iomem *sys, *end;
unsigned char *buf = ptr;
cs_dbg(s, 3, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
dev_dbg(&s->dev, "pcmcia_read_cis_mem(%d, %#x, %u)\n", attr, addr, len);
if (attr & IS_INDIRECT) {
/* Indirect accesses use a bunch of special registers at fixed
......@@ -190,7 +190,7 @@ int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
addr = 0;
}
}
cs_dbg(s, 3, " %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
dev_dbg(&s->dev, " %#2.2x %#2.2x %#2.2x %#2.2x ...\n",
*(u_char *)(ptr+0), *(u_char *)(ptr+1),
*(u_char *)(ptr+2), *(u_char *)(ptr+3));
return 0;
......@@ -204,7 +204,7 @@ void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, u_int addr,
void __iomem *sys, *end;
unsigned char *buf = ptr;
cs_dbg(s, 3, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
dev_dbg(&s->dev, "pcmcia_write_cis_mem(%d, %#x, %u)\n", attr, addr, len);
if (attr & IS_INDIRECT) {
/* Indirect accesses use a bunch of special registers at fixed
......@@ -584,7 +584,7 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, tuple_
ofs += link[1] + 2;
}
if (i == MAX_TUPLES) {
cs_dbg(s, 1, "cs: overrun in pcmcia_get_next_tuple\n");
dev_dbg(&s->dev, "cs: overrun in pcmcia_get_next_tuple\n");
return -ENOSPC;
}
......@@ -1440,7 +1440,7 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse)
break;
}
if (ret)
__cs_dbg(0, "parse_tuple failed %d\n", ret);
pr_debug("parse_tuple failed %d\n", ret);
return ret;
}
EXPORT_SYMBOL(pcmcia_parse_tuple);
......
......@@ -61,17 +61,6 @@ INT_MODULE_PARM(unreset_limit, 30); /* unreset_check's */
/* Access speed for attribute memory windows */
INT_MODULE_PARM(cis_speed, 300); /* ns */
#ifdef CONFIG_PCMCIA_DEBUG
static int pc_debug;
module_param(pc_debug, int, 0644);
int cs_debug_level(int level)
{
return pc_debug > level;
}
#endif
socket_state_t dead_socket = {
.csc_mask = SS_DETECT,
......@@ -182,7 +171,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
if (!socket || !socket->ops || !socket->dev.parent || !socket->resource_ops)
return -EINVAL;
cs_dbg(socket, 0, "pcmcia_register_socket(0x%p)\n", socket->ops);
dev_dbg(&socket->dev, "pcmcia_register_socket(0x%p)\n", socket->ops);
spin_lock_init(&socket->lock);
......@@ -274,7 +263,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
if (!socket)
return;
cs_dbg(socket, 0, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
dev_dbg(&socket->dev, "pcmcia_unregister_socket(0x%p)\n", socket->ops);
if (socket->thread)
kthread_stop(socket->thread);
......@@ -327,7 +316,7 @@ static int send_event(struct pcmcia_socket *s, event_t event, int priority)
if (s->state & SOCKET_CARDBUS)
return 0;
cs_dbg(s, 1, "send_event(event %d, pri %d, callback 0x%p)\n",
dev_dbg(&s->dev, "send_event(event %d, pri %d, callback 0x%p)\n",
event, priority, s->callback);
if (!s->callback)
......@@ -344,7 +333,7 @@ static int send_event(struct pcmcia_socket *s, event_t event, int priority)
static void socket_remove_drivers(struct pcmcia_socket *skt)
{
cs_dbg(skt, 4, "remove_drivers\n");
dev_dbg(&skt->dev, "remove_drivers\n");
send_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH);
}
......@@ -353,7 +342,7 @@ static int socket_reset(struct pcmcia_socket *skt)
{
int status, i;
cs_dbg(skt, 4, "reset\n");
dev_dbg(&skt->dev, "reset\n");
skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
skt->ops->set_socket(skt, &skt->socket);
......@@ -375,7 +364,7 @@ static int socket_reset(struct pcmcia_socket *skt)
msleep(unreset_check * 10);
}
cs_err(skt, "time out after reset.\n");
dev_printk(KERN_ERR, &skt->dev, "time out after reset.\n");
return -ETIMEDOUT;
}
......@@ -389,7 +378,7 @@ static void socket_shutdown(struct pcmcia_socket *s)
{
int status;
cs_dbg(s, 4, "shutdown\n");
dev_dbg(&s->dev, "shutdown\n");
socket_remove_drivers(s);
s->state &= SOCKET_INUSE | SOCKET_PRESENT;
......@@ -424,7 +413,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
{
int status, i;
cs_dbg(skt, 4, "setup\n");
dev_dbg(&skt->dev, "setup\n");
skt->ops->get_status(skt, &status);
if (!(status & SS_DETECT))
......@@ -444,13 +433,15 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
}
if (status & SS_PENDING) {
cs_err(skt, "voltage interrogation timed out.\n");
dev_printk(KERN_ERR, &skt->dev,
"voltage interrogation timed out.\n");
return -ETIMEDOUT;
}
if (status & SS_CARDBUS) {
if (!(skt->features & SS_CAP_CARDBUS)) {
cs_err(skt, "cardbus cards are not supported.\n");
dev_printk(KERN_ERR, &skt->dev,
"cardbus cards are not supported.\n");
return -EINVAL;
}
skt->state |= SOCKET_CARDBUS;
......@@ -464,7 +455,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
else if (!(status & SS_XVCARD))
skt->socket.Vcc = skt->socket.Vpp = 50;
else {
cs_err(skt, "unsupported voltage key.\n");
dev_printk(KERN_ERR, &skt->dev, "unsupported voltage key.\n");
return -EIO;
}
......@@ -481,7 +472,7 @@ static int socket_setup(struct pcmcia_socket *skt, int initial_delay)
skt->ops->get_status(skt, &status);
if (!(status & SS_POWERON)) {
cs_err(skt, "unable to apply power.\n");
dev_printk(KERN_ERR, &skt->dev, "unable to apply power.\n");
return -EIO;
}
......@@ -501,7 +492,7 @@ static int socket_insert(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 4, "insert\n");
dev_dbg(&skt->dev, "insert\n");
if (!cs_socket_get(skt))
return -ENODEV;
......@@ -521,7 +512,7 @@ static int socket_insert(struct pcmcia_socket *skt)
skt->state |= SOCKET_CARDBUS_CONFIG;
}
#endif
cs_dbg(skt, 4, "insert done\n");
dev_dbg(&skt->dev, "insert done\n");
send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
} else {
......@@ -573,7 +564,7 @@ static int socket_resume(struct pcmcia_socket *skt)
* FIXME: need a better check here for cardbus cards.
*/
if (verify_cis_cache(skt) != 0) {
cs_dbg(skt, 4, "cis mismatch - different card\n");
dev_dbg(&skt->dev, "cis mismatch - different card\n");
socket_remove_drivers(skt);
destroy_cis_cache(skt);
/*
......@@ -584,7 +575,7 @@ static int socket_resume(struct pcmcia_socket *skt)
msleep(200);
send_event(skt, CS_EVENT_CARD_INSERTION, CS_EVENT_PRI_LOW);
} else {
cs_dbg(skt, 4, "cis matches cache\n");
dev_dbg(&skt->dev, "cis matches cache\n");
send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
}
} else {
......@@ -706,7 +697,7 @@ static int pccardd(void *__skt)
void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
{
unsigned long flags;
cs_dbg(s, 4, "parse_events: events %08x\n", events);
dev_dbg(&s->dev, "parse_events: events %08x\n", events);
if (s->thread) {
spin_lock_irqsave(&s->thread_lock, flags);
s->thread_events |= events;
......@@ -756,7 +747,7 @@ int pcmcia_reset_card(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 1, "resetting socket\n");
dev_dbg(&skt->dev, "resetting socket\n");
mutex_lock(&skt->skt_mutex);
do {
......@@ -801,7 +792,7 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 1, "suspending socket\n");
dev_dbg(&skt->dev, "suspending socket\n");
mutex_lock(&skt->skt_mutex);
do {
......@@ -831,7 +822,7 @@ int pcmcia_resume_card(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 1, "waking up socket\n");
dev_dbg(&skt->dev, "waking up socket\n");
mutex_lock(&skt->skt_mutex);
do {
......@@ -859,7 +850,7 @@ int pcmcia_eject_card(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 1, "user eject request\n");
dev_dbg(&skt->dev, "user eject request\n");
mutex_lock(&skt->skt_mutex);
do {
......@@ -888,7 +879,7 @@ int pcmcia_insert_card(struct pcmcia_socket *skt)
{
int ret;
cs_dbg(skt, 1, "user insert request\n");
dev_dbg(&skt->dev, "user insert request\n");
mutex_lock(&skt->skt_mutex);
do {
......
......@@ -107,28 +107,6 @@ static inline void cs_socket_put(struct pcmcia_socket *skt)
}
}
#ifdef CONFIG_PCMCIA_DEBUG
extern int cs_debug_level(int);
#define cs_dbg(skt, lvl, fmt, arg...) do { \
if (cs_debug_level(lvl)) \
dev_printk(KERN_DEBUG, &skt->dev, \
"cs: " fmt, ## arg); \
} while (0)
#define __cs_dbg(lvl, fmt, arg...) do { \
if (cs_debug_level(lvl)) \
printk(KERN_DEBUG \
"cs: " fmt, ## arg); \
} while (0)
#else
#define cs_dbg(skt, lvl, fmt, arg...) do { } while (0)
#define __cs_dbg(lvl, fmt, arg...) do { } while (0)
#endif
#define cs_err(skt, fmt, arg...) \
dev_printk(KERN_ERR, &skt->dev, "cs: " fmt, ## arg)
/*
* Stuff internal to module "pcmcia_core":
......
This diff is collapsed.
......@@ -58,17 +58,6 @@ typedef struct user_info_t {
} user_info_t;
#ifdef CONFIG_PCMCIA_DEBUG
extern int ds_pc_debug;
#define ds_dbg(lvl, fmt, arg...) do { \
if (ds_pc_debug >= lvl) \
printk(KERN_DEBUG "ds: " fmt , ## arg); \
} while (0)
#else
#define ds_dbg(lvl, fmt, arg...) do { } while (0)
#endif
static struct pcmcia_device *get_pcmcia_device(struct pcmcia_socket *s,
unsigned int function)
{
......@@ -431,7 +420,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
if (!s)
return -EINVAL;
ds_dbg(2, "bind_request(%d, '%s')\n", s->sock,
pr_debug("bind_request(%d, '%s')\n", s->sock,
(char *)bind_info->dev_info);
p_drv = get_pcmcia_driver(&bind_info->dev_info);
......@@ -623,7 +612,7 @@ static int ds_open(struct inode *inode, struct file *file)
static int warning_printed = 0;
int ret = 0;
ds_dbg(0, "ds_open(socket %d)\n", i);
pr_debug("ds_open(socket %d)\n", i);
lock_kernel();
s = pcmcia_get_socket_by_nr(i);
......@@ -685,7 +674,7 @@ static int ds_release(struct inode *inode, struct file *file)
struct pcmcia_socket *s;
user_info_t *user, **link;
ds_dbg(0, "ds_release(socket %d)\n", iminor(inode));
pr_debug("ds_release(socket %d)\n", iminor(inode));
user = file->private_data;
if (CHECK_USER(user))
......@@ -719,7 +708,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
user_info_t *user;
int ret;
ds_dbg(2, "ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode));
pr_debug("ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode));
if (count < 4)
return -EINVAL;
......@@ -744,7 +733,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
static ssize_t ds_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
ds_dbg(2, "ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode));
pr_debug("ds_write(socket %d)\n", iminor(file->f_path.dentry->d_inode));
if (count != 4)
return -EINVAL;
......@@ -762,7 +751,7 @@ static u_int ds_poll(struct file *file, poll_table *wait)
struct pcmcia_socket *s;
user_info_t *user;
ds_dbg(2, "ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode));
pr_debug("ds_poll(socket %d)\n", iminor(file->f_path.dentry->d_inode));
user = file->private_data;
if (CHECK_USER(user))
......@@ -790,7 +779,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
ds_ioctl_arg_t *buf;
user_info_t *user;
ds_dbg(2, "ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
pr_debug("ds_ioctl(socket %d, %#x, %#lx)\n", iminor(inode), cmd, arg);
user = file->private_data;
if (CHECK_USER(user))
......@@ -809,13 +798,13 @@ static int ds_ioctl(struct inode * inode, struct file * file,
if (cmd & IOC_IN) {
if (!access_ok(VERIFY_READ, uarg, size)) {
ds_dbg(3, "ds_ioctl(): verify_read = %d\n", -EFAULT);
pr_debug("ds_ioctl(): verify_read = %d\n", -EFAULT);
return -EFAULT;
}
}
if (cmd & IOC_OUT) {
if (!access_ok(VERIFY_WRITE, uarg, size)) {
ds_dbg(3, "ds_ioctl(): verify_write = %d\n", -EFAULT);
pr_debug("ds_ioctl(): verify_write = %d\n", -EFAULT);
return -EFAULT;
}
}
......@@ -962,7 +951,7 @@ static int ds_ioctl(struct inode * inode, struct file * file,
}
if ((err == 0) && (ret != 0)) {
ds_dbg(2, "ds_ioctl: ret = %d\n", ret);
pr_debug("ds_ioctl: ret = %d\n", ret);
switch (ret) {
case -ENODEV:
case -EINVAL:
......
......@@ -44,21 +44,6 @@ static u8 pcmcia_used_irq[NR_IRQS];
#endif
#ifdef CONFIG_PCMCIA_DEBUG
extern int ds_pc_debug;
#define ds_dbg(skt, lvl, fmt, arg...) do { \
if (ds_pc_debug >= lvl) \
dev_printk(KERN_DEBUG, &skt->dev, \
"pcmcia_resource: " fmt, \
## arg); \
} while (0)
#else
#define ds_dbg(skt, lvl, fmt, arg...) do { } while (0)
#endif
/** alloc_io_space
*
* Special stuff for managing IO windows, because they are scarce
......@@ -73,14 +58,14 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr,
align = (*base) ? (lines ? 1<<lines : 0) : 1;
if (align && (align < num)) {
if (*base) {
ds_dbg(s, 0, "odd IO request: num %#x align %#x\n",
dev_dbg(&s->dev, "odd IO request: num %#x align %#x\n",
num, align);
align = 0;
} else
while (align && (align < num)) align <<= 1;
}
if (*base & ~(align-1)) {
ds_dbg(s, 0, "odd IO request: base %#x align %#x\n",
dev_dbg(&s->dev, "odd IO request: base %#x align %#x\n",
*base, align);
align = 0;
}
......@@ -253,12 +238,12 @@ int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
return -EINVAL;
s = win->sock;
if (req->Page != 0) {
ds_dbg(s, 0, "failure: requested page is zero\n");
dev_dbg(&s->dev, "failure: requested page is zero\n");
return -EINVAL;
}
win->ctl.card_start = req->CardOffset;
if (s->ops->set_mem_map(s, &win->ctl) != 0) {
ds_dbg(s, 0, "failed to set_mem_map\n");
dev_dbg(&s->dev, "failed to set_mem_map\n");
return -EIO;
}
return 0;
......@@ -296,7 +281,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
}
if (mod->Attributes & CONF_VCC_CHANGE_VALID) {
ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
return -EINVAL;
}
......@@ -304,7 +289,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
if (mod->Vpp1 != mod->Vpp2) {
ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n");
dev_dbg(&s->dev, "Vpp1 and Vpp2 must be the same\n");
return -EINVAL;
}
s->socket.Vpp = mod->Vpp1;
......@@ -315,7 +300,7 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
}
} else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
ds_dbg(s, 0, "changing Vcc is not allowed at this time\n");
dev_dbg(&s->dev, "changing Vcc is not allowed at this time\n");
return -EINVAL;
}
......@@ -426,11 +411,11 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
if (c->state & CONFIG_LOCKED)
return -EACCES;
if (c->irq.Attributes != req->Attributes) {
ds_dbg(s, 0, "IRQ attributes must match assigned ones\n");
dev_dbg(&s->dev, "IRQ attributes must match assigned ones\n");
return -EINVAL;
}
if (s->irq.AssignedIRQ != req->AssignedIRQ) {
ds_dbg(s, 0, "IRQ must match assigned one\n");
dev_dbg(&s->dev, "IRQ must match assigned one\n");
return -EINVAL;
}
if (--s->irq.Config == 0) {
......@@ -493,7 +478,7 @@ int pcmcia_request_configuration(struct pcmcia_device *p_dev,
return -ENODEV;
if (req->IntType & INT_CARDBUS) {
ds_dbg(p_dev->socket, 0, "IntType may not be INT_CARDBUS\n");
dev_dbg(&s->dev, "IntType may not be INT_CARDBUS\n");
return -EINVAL;
}
c = p_dev->function_config;
......@@ -619,31 +604,31 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
if (c->state & CONFIG_LOCKED)
return -EACCES;
if (c->state & CONFIG_IO_REQ) {
ds_dbg(s, 0, "IO already configured\n");
dev_dbg(&s->dev, "IO already configured\n");
return -EBUSY;
}
if (req->Attributes1 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS)) {
ds_dbg(s, 0, "bad attribute setting for IO region 1\n");
dev_dbg(&s->dev, "bad attribute setting for IO region 1\n");
return -EINVAL;
}
if ((req->NumPorts2 > 0) &&
(req->Attributes2 & (IO_SHARED | IO_FORCE_ALIAS_ACCESS))) {
ds_dbg(s, 0, "bad attribute setting for IO region 2\n");
dev_dbg(&s->dev, "bad attribute setting for IO region 2\n");
return -EINVAL;
}
ds_dbg(s, 1, "trying to allocate resource 1\n");
dev_dbg(&s->dev, "trying to allocate resource 1\n");
if (alloc_io_space(s, req->Attributes1, &req->BasePort1,
req->NumPorts1, req->IOAddrLines)) {
ds_dbg(s, 0, "allocation of resource 1 failed\n");
dev_dbg(&s->dev, "allocation of resource 1 failed\n");
return -EBUSY;
}
if (req->NumPorts2) {
ds_dbg(s, 1, "trying to allocate resource 2\n");
dev_dbg(&s->dev, "trying to allocate resource 2\n");
if (alloc_io_space(s, req->Attributes2, &req->BasePort2,
req->NumPorts2, req->IOAddrLines)) {
ds_dbg(s, 0, "allocation of resource 2 failed\n");
dev_dbg(&s->dev, "allocation of resource 2 failed\n");
release_io_space(s, req->BasePort1, req->NumPorts1);
return -EBUSY;
}
......@@ -687,7 +672,7 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
if (c->state & CONFIG_LOCKED)
return -EACCES;
if (c->state & CONFIG_IRQ_REQ) {
ds_dbg(s, 0, "IRQ already configured\n");
dev_dbg(&s->dev, "IRQ already configured\n");
return -EBUSY;
}
......@@ -798,7 +783,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
if (!(s->state & SOCKET_PRESENT))
return -ENODEV;
if (req->Attributes & (WIN_PAGED | WIN_SHARED)) {
ds_dbg(s, 0, "bad attribute setting for iomem region\n");
dev_dbg(&s->dev, "bad attribute setting for iomem region\n");
return -EINVAL;
}
......@@ -809,12 +794,12 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
(req->Attributes & WIN_STRICT_ALIGN)) ?
req->Size : s->map_size);
if (req->Size & (s->map_size-1)) {
ds_dbg(s, 0, "invalid map size\n");
dev_dbg(&s->dev, "invalid map size\n");
return -EINVAL;
}
if ((req->Base && (s->features & SS_CAP_STATIC_MAP)) ||
(req->Base & (align-1))) {
ds_dbg(s, 0, "invalid base address\n");
dev_dbg(&s->dev, "invalid base address\n");
return -EINVAL;
}
if (req->Base)
......@@ -824,7 +809,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
for (w = 0; w < MAX_WIN; w++)
if (!(s->state & SOCKET_WIN_REQ(w))) break;
if (w == MAX_WIN) {
ds_dbg(s, 0, "all windows are used already\n");
dev_dbg(&s->dev, "all windows are used already\n");
return -EINVAL;
}
......@@ -838,7 +823,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
win->ctl.res = pcmcia_find_mem_region(req->Base, req->Size, align,
(req->Attributes & WIN_MAP_BELOW_1MB), s);
if (!win->ctl.res) {
ds_dbg(s, 0, "allocating mem region failed\n");
dev_dbg(&s->dev, "allocating mem region failed\n");
return -EINVAL;
}
}
......@@ -858,7 +843,7 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h
win->ctl.flags |= MAP_USE_WAIT;
win->ctl.card_start = 0;
if (s->ops->set_mem_map(s, &win->ctl) != 0) {
ds_dbg(s, 0, "failed to set memory mapping\n");
dev_dbg(&s->dev, "failed to set memory mapping\n");
return -EIO;
}
s->state |= SOCKET_WIN_REQ(w);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment