lkml.org 
[lkml]   [2009]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: manual merge of the pcmcia tree with the pxa tree
On Mon, Nov 30, 2009 at 10:24:44AM +0100, Marc Zyngier wrote:
> Sounds good. I'll post rebased patches as soon as PCMCIA hits Linus'
> tree.

What would be a better idea is to rework the driver once my changes have
hit. If you need to pass additional data around, you can do it like this:

struct my_socket {
struct soc_pcmcia_socket skt;
...
};

#define to_my_socket(s) container_of(s, struct my_socket, skt)

static struct pcmcia_low_level my_ops = {
};

static int my_probe(struct platform_device *dev)
{
struct my_socket *skts;

pxa2xx_drv_pcmcia_ops(&my_ops);

skts = kzalloc(sizeof(*skts) * nr, GFP_KERNEL);
if (!skts)
...

for (i = 0; i < nr; i++) {
skts[i].skt.nr = i;
skts[i].skt.ops = &my_ops;
skts[i].skt.socket.owner = THIS_MODULE;
skts[i].skt.socket.parent = &dev->dev;
skts[i].skt.socket.pci_irq = the_socket_irq;
ret = pxa2xx_drv_pcmcia_add_one(&skts[i].skt);
if (ret)
goto free_registered_sockets_and_return_ret;
}
}


\
 
 \ /
  Last update: 2009-11-30 10:51    [W:0.051 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site