mirror of https://gitee.com/openkylin/linux.git
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: ensure correct logging in do_io_probe pcmcia: add another pata/ide ID pcmcia: add braces in error path pcmcia: struct device - replace bus_id with dev_name(), dev_set_name() pcmcia: setup resource information for pseudo multifunction devices. pcmcia: fix indentation & braces disagreement - add braces
This commit is contained in:
commit
d659fc14cb
|
@ -444,6 +444,7 @@ static struct pcmcia_device_id ide_ids[] = {
|
||||||
PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
|
PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209),
|
||||||
PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
|
PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e),
|
||||||
PCMCIA_MFC_DEVICE_PROD_ID12(1, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6),
|
PCMCIA_MFC_DEVICE_PROD_ID12(1, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6),
|
||||||
|
PCMCIA_DEVICE_PROD_ID2("Flash Card", 0x5a362506),
|
||||||
PCMCIA_DEVICE_NULL,
|
PCMCIA_DEVICE_NULL,
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(pcmcia, ide_ids);
|
MODULE_DEVICE_TABLE(pcmcia, ide_ids);
|
||||||
|
|
|
@ -351,10 +351,11 @@ int verify_cis_cache(struct pcmcia_socket *s)
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = kmalloc(256, GFP_KERNEL);
|
buf = kmalloc(256, GFP_KERNEL);
|
||||||
if (buf == NULL)
|
if (buf == NULL) {
|
||||||
dev_printk(KERN_WARNING, &s->dev,
|
dev_printk(KERN_WARNING, &s->dev,
|
||||||
"no memory for verifying CIS\n");
|
"no memory for verifying CIS\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
list_for_each_entry(cis, &s->cis_cache, node) {
|
list_for_each_entry(cis, &s->cis_cache, node) {
|
||||||
int len = cis->len;
|
int len = cis->len;
|
||||||
|
|
||||||
|
|
|
@ -186,12 +186,6 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
|
||||||
|
|
||||||
spin_lock_init(&socket->lock);
|
spin_lock_init(&socket->lock);
|
||||||
|
|
||||||
if (socket->resource_ops->init) {
|
|
||||||
ret = socket->resource_ops->init(socket);
|
|
||||||
if (ret)
|
|
||||||
return (ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* try to obtain a socket number [yes, it gets ugly if we
|
/* try to obtain a socket number [yes, it gets ugly if we
|
||||||
* register more than 2^sizeof(unsigned int) pcmcia
|
* register more than 2^sizeof(unsigned int) pcmcia
|
||||||
* sockets... but the socket number is deprecated
|
* sockets... but the socket number is deprecated
|
||||||
|
@ -226,7 +220,7 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
|
||||||
/* set proper values in socket->dev */
|
/* set proper values in socket->dev */
|
||||||
dev_set_drvdata(&socket->dev, socket);
|
dev_set_drvdata(&socket->dev, socket);
|
||||||
socket->dev.class = &pcmcia_socket_class;
|
socket->dev.class = &pcmcia_socket_class;
|
||||||
snprintf(socket->dev.bus_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock);
|
dev_set_name(&socket->dev, "pcmcia_socket%u", socket->sock);
|
||||||
|
|
||||||
/* base address = 0, map = 0 */
|
/* base address = 0, map = 0 */
|
||||||
socket->cis_mem.flags = 0;
|
socket->cis_mem.flags = 0;
|
||||||
|
@ -239,6 +233,12 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
|
||||||
mutex_init(&socket->skt_mutex);
|
mutex_init(&socket->skt_mutex);
|
||||||
spin_lock_init(&socket->thread_lock);
|
spin_lock_init(&socket->thread_lock);
|
||||||
|
|
||||||
|
if (socket->resource_ops->init) {
|
||||||
|
ret = socket->resource_ops->init(socket);
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
tsk = kthread_run(pccardd, socket, "pccardd");
|
tsk = kthread_run(pccardd, socket, "pccardd");
|
||||||
if (IS_ERR(tsk)) {
|
if (IS_ERR(tsk)) {
|
||||||
ret = PTR_ERR(tsk);
|
ret = PTR_ERR(tsk);
|
||||||
|
|
|
@ -622,7 +622,6 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
|
||||||
{
|
{
|
||||||
struct pcmcia_device *p_dev, *tmp_dev;
|
struct pcmcia_device *p_dev, *tmp_dev;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int bus_id_len;
|
|
||||||
|
|
||||||
s = pcmcia_get_socket(s);
|
s = pcmcia_get_socket(s);
|
||||||
if (!s)
|
if (!s)
|
||||||
|
@ -650,12 +649,12 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
|
||||||
/* by default don't allow DMA */
|
/* by default don't allow DMA */
|
||||||
p_dev->dma_mask = DMA_MASK_NONE;
|
p_dev->dma_mask = DMA_MASK_NONE;
|
||||||
p_dev->dev.dma_mask = &p_dev->dma_mask;
|
p_dev->dev.dma_mask = &p_dev->dma_mask;
|
||||||
bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no);
|
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
|
||||||
|
if (!dev_name(&p_dev->dev))
|
||||||
p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL);
|
goto err_free;
|
||||||
|
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
|
||||||
if (!p_dev->devname)
|
if (!p_dev->devname)
|
||||||
goto err_free;
|
goto err_free;
|
||||||
sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id);
|
|
||||||
ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname);
|
ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname);
|
||||||
|
|
||||||
spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
|
spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
|
||||||
|
@ -668,6 +667,8 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
|
||||||
list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list)
|
list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list)
|
||||||
if (p_dev->func == tmp_dev->func) {
|
if (p_dev->func == tmp_dev->func) {
|
||||||
p_dev->function_config = tmp_dev->function_config;
|
p_dev->function_config = tmp_dev->function_config;
|
||||||
|
p_dev->io = tmp_dev->io;
|
||||||
|
p_dev->irq = tmp_dev->irq;
|
||||||
kref_get(&p_dev->function_config->ref);
|
kref_get(&p_dev->function_config->ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -302,9 +302,10 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev,
|
||||||
/* We only allow changing Vpp1 and Vpp2 to the same value */
|
/* We only allow changing Vpp1 and Vpp2 to the same value */
|
||||||
if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
|
if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) &&
|
||||||
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
|
(mod->Attributes & CONF_VPP2_CHANGE_VALID)) {
|
||||||
if (mod->Vpp1 != mod->Vpp2)
|
if (mod->Vpp1 != mod->Vpp2) {
|
||||||
ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n");
|
ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
s->socket.Vpp = mod->Vpp1;
|
s->socket.Vpp = mod->Vpp1;
|
||||||
if (s->ops->set_socket(s, &s->socket)) {
|
if (s->ops->set_socket(s, &s->socket)) {
|
||||||
dev_printk(KERN_WARNING, &s->dev,
|
dev_printk(KERN_WARNING, &s->dev,
|
||||||
|
|
|
@ -71,7 +71,7 @@ static DEFINE_MUTEX(rsrc_mutex);
|
||||||
======================================================================*/
|
======================================================================*/
|
||||||
|
|
||||||
static struct resource *
|
static struct resource *
|
||||||
make_resource(resource_size_t b, resource_size_t n, int flags, char *name)
|
make_resource(resource_size_t b, resource_size_t n, int flags, const char *name)
|
||||||
{
|
{
|
||||||
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
|
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ static int nonstatic_adjust_io_region(struct resource *res, unsigned long r_star
|
||||||
static struct resource *nonstatic_find_io_region(unsigned long base, int num,
|
static struct resource *nonstatic_find_io_region(unsigned long base, int num,
|
||||||
unsigned long align, struct pcmcia_socket *s)
|
unsigned long align, struct pcmcia_socket *s)
|
||||||
{
|
{
|
||||||
struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.bus_id);
|
struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev));
|
||||||
struct socket_data *s_data = s->resource_data;
|
struct socket_data *s_data = s->resource_data;
|
||||||
struct pcmcia_align_data data;
|
struct pcmcia_align_data data;
|
||||||
unsigned long min = base;
|
unsigned long min = base;
|
||||||
|
@ -658,7 +658,7 @@ static struct resource *nonstatic_find_io_region(unsigned long base, int num,
|
||||||
static struct resource * nonstatic_find_mem_region(u_long base, u_long num,
|
static struct resource * nonstatic_find_mem_region(u_long base, u_long num,
|
||||||
u_long align, int low, struct pcmcia_socket *s)
|
u_long align, int low, struct pcmcia_socket *s)
|
||||||
{
|
{
|
||||||
struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.bus_id);
|
struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev));
|
||||||
struct socket_data *s_data = s->resource_data;
|
struct socket_data *s_data = s->resource_data;
|
||||||
struct pcmcia_align_data data;
|
struct pcmcia_align_data data;
|
||||||
unsigned long min, max;
|
unsigned long min, max;
|
||||||
|
|
Loading…
Reference in New Issue