コード例 #1
0
ファイル: hp_sdc_mlc.c プロジェクト: rrowicki/Chrono_Kernel-1
static int __init hp_sdc_mlc_init(void)
{
	hil_mlc *mlc = &hp_sdc_mlc;
	int err;

#ifdef __mc68000__
	if (!MACH_IS_HP300)
		return -ENODEV;
#endif

;

	hp_sdc_mlc_priv.emtestmode = 0;
	hp_sdc_mlc_priv.trans.seq = hp_sdc_mlc_priv.tseq;
	hp_sdc_mlc_priv.trans.act.semaphore = &mlc->osem;
	hp_sdc_mlc_priv.got5x = 0;

	mlc->cts = &hp_sdc_mlc_cts;
	mlc->in	= &hp_sdc_mlc_in;
	mlc->out = &hp_sdc_mlc_out;
	mlc->priv = &hp_sdc_mlc_priv;

	err = hil_mlc_register(mlc);
	if (err) {
;
		return err;
	}

	if (hp_sdc_request_hil_irq(&hp_sdc_mlc_isr)) {
;
		if (hil_mlc_unregister(mlc))
//			printk(KERN_ERR PREFIX "Failed to unregister MLC structure with hil_mlc.\n"
;
		return -EBUSY;
	}

	return 0;
}
コード例 #2
0
static int __init hp_sdc_mlc_init(void)
{
	hil_mlc *mlc = &hp_sdc_mlc;

#ifdef __mc68000__
	if (!MACH_IS_HP300)
		return -ENODEV;
#endif

	printk(KERN_INFO PREFIX "Registering the System Domain Controller's HIL MLC.\n");

	hp_sdc_mlc_priv.emtestmode = 0;
	hp_sdc_mlc_priv.trans.seq = hp_sdc_mlc_priv.tseq;
	hp_sdc_mlc_priv.trans.act.semaphore = &mlc->osem;
	hp_sdc_mlc_priv.got5x = 0;

	mlc->cts = &hp_sdc_mlc_cts;
	mlc->in	= &hp_sdc_mlc_in;
	mlc->out = &hp_sdc_mlc_out;
	mlc->priv = &hp_sdc_mlc_priv;

	if (hil_mlc_register(mlc)) {
		printk(KERN_WARNING PREFIX "Failed to register MLC structure with hil_mlc\n");
		goto err0;
	}

	if (hp_sdc_request_hil_irq(&hp_sdc_mlc_isr)) {
		printk(KERN_WARNING PREFIX "Request for raw HIL ISR hook denied\n");
		goto err1;
	}
	return 0;
 err1:
	if (hil_mlc_unregister(mlc))
		printk(KERN_ERR PREFIX "Failed to unregister MLC structure with hil_mlc.\n"
			"This is bad.  Could cause an oops.\n");
 err0:
	return -EBUSY;
}