#define CHIP_IRQ_VME (1<<5) /* interrupt is VME bus and requires VME bridge */
#define CHIP_IRQ_CUSTOM (1<<6) /* custom interrupt provided by board or chip code */
#define CHIP_IRQ_FAST (1<<7) /* interrupt handler only schedules postponed processing */
+#define CHIP_KEEP_DATA (1<<8) /* let the hotplug device free its chip_data structure itself */
#define CHIP_MAX_IRQLOOP 1000
int chip_idx; /* chip index in candevice_t.chip[] */
int chip_irq;
can_ioptr_t chip_base_addr;
- unsigned int flags;
+ uint16_t flags;
long clock; /* Chip clock in Hz */
long baudrate;
}
can_checked_free(chip->chipspecops);
+
+ if(~chip->flags & CHIP_KEEP_DATA)
+ can_checked_free(chip->chip_data);
+ chip->chip_data = NULL;
chip->chipspecops=NULL;
}
usbcan_fill_chipspecops(chip);
- candev->chip[chipnr]->flags|=CHIP_IRQ_CUSTOM;
+ candev->chip[chipnr]->flags|=CHIP_IRQ_CUSTOM|CHIP_KEEP_DATA;
candev->chip[chipnr]->chip_base_addr=0;
candev->chip[chipnr]->clock = 0;