if ((result = dvb_ca_en50221_init(budget_ci->budget.dvb_adapter, 
if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, 
static int ciintf_init(struct budget_ci *budget_ci){	struct saa7146_dev *saa = budget_ci->budget.dev;	int flags;	int result;	memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221));	// enable DEBI pins	saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800);	// test if it is there	if ((ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0) & 0xa0) != 0xa0) {		result = -ENODEV;		goto error;	}	// determine whether a CAM is present or not	flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0);	budget_ci->slot_status = SLOTSTATUS_NONE;	if (flags & CICONTROL_CAMDETECT)		budget_ci->slot_status = SLOTSTATUS_PRESENT;	// register CI interface	budget_ci->ca.owner = THIS_MODULE;	budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem;	budget_ci->ca.write_attribute_mem = ciintf_write_attribute_mem;	budget_ci->ca.read_cam_control = ciintf_read_cam_control;	budget_ci->ca.write_cam_control = ciintf_write_cam_control;	budget_ci->ca.slot_reset = ciintf_slot_reset;	budget_ci->ca.slot_shutdown = ciintf_slot_shutdown;	budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable;	budget_ci->ca.data = budget_ci;	if ((result = dvb_ca_en50221_init(budget_ci->budget.dvb_adapter,					  &budget_ci->ca,					  DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE |					  DVB_CA_EN50221_FLAG_IRQ_FR |					  DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) {		printk("budget_ci: CI interface detected, but initialisation failed.\n");		goto error;	}	// Setup CI slot IRQ	tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci);	if (budget_ci->slot_status != SLOTSTATUS_NONE) {		saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO);	} else {		saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);	}	saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03);	ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1,			       CICONTROL_RESET, 1, 0);	// success!	printk("budget_ci: CI interface initialised\n");	budget_ci->budget.ci_present = 1;	// forge a fake CI IRQ so the CAM state is setup correctly	flags = DVB_CA_EN50221_CAMCHANGE_REMOVED;	if (budget_ci->slot_status != SLOTSTATUS_NONE)		flags = DVB_CA_EN50221_CAMCHANGE_INSERTED;	dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags);	return 0;error:	saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16));	return result;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fdc53a6dbfea18e621dd23ed5cfb160837d7ce52/budget-ci.c/buggy/drivers/media/dvb/ttpci/budget-ci.c