/* pcmcia_loop_config() loops over all configuration options, and calls the driver-specific conf_check() for each one, checking whether it is a valid one. Returns 0 on success or errorcode otherwise.  */
int pcmcia_loop_config(struct pcmcia_device *p_dev, int(*conf_check)(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt, unsigned int vcc, void *priv_data), void *priv_data)
/* pcmcia_loop_config() loops over all configuration options, and calls the driver-specific conf_check() for each one, checking whether it is a valid one. Returns 0 on success or errorcode otherwise.  */
int pcmcia_loop_config(struct pcmcia_device *p_dev, int(*conf_check)(struct pcmcia_device *p_dev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt, unsigned int vcc, void *priv_data), void *priv_data)
{
	struct pcmcia_cfg_mem *cfg_mem;
	int ret;
	cfg_mem = kzalloc(sizeof(struct pcmcia_cfg_mem), GFP_KERNEL);
	if (cfg_mem == NULL)
		return -ENOMEM;
	cfg_mem->p_dev = p_dev;
	cfg_mem->conf_check = conf_check;
	cfg_mem->priv_data = priv_data;
	ret = pccard_loop_tuple(p_dev->socket, p_dev->func,
				CISTPL_CFTABLE_ENTRY, &cfg_mem->parse,
				cfg_mem, pcmcia_do_loop_config);
	kfree(cfg_mem);
	return ret;
}