Re: linux-next: manual merge of the pcmcia tree with the pxa tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
	}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-next" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux