#endif /* CONFIG_PMAC_PBOOK */ 
static int __init via_pmu_dev_init(void){	if (vias == NULL)		return -ENODEV;#ifndef CONFIG_PPC64	request_OF_resource(vias, 0, NULL);#endif#ifdef CONFIG_PMAC_BACKLIGHT	/* Enable backlight */	register_backlight_controller(&pmu_backlight_controller, NULL, "pmu");#endif /* CONFIG_PMAC_BACKLIGHT */#ifdef CONFIG_PMAC_PBOOK  	if (machine_is_compatible("AAPL,3400/2400") ||  		machine_is_compatible("AAPL,3500")) {		int mb = pmac_call_feature(PMAC_FTR_GET_MB_INFO,			NULL, PMAC_MB_INFO_MODEL, 0);		pmu_battery_count = 1;		if (mb == PMAC_TYPE_COMET)			pmu_batteries[0].flags |= PMU_BATT_TYPE_COMET;		else			pmu_batteries[0].flags |= PMU_BATT_TYPE_HOOPER;	} else if (machine_is_compatible("AAPL,PowerBook1998") ||		machine_is_compatible("PowerBook1,1")) {		pmu_battery_count = 2;		pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART;		pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;	} else {		struct device_node* prim = find_devices("power-mgt");		u32 *prim_info = NULL;		if (prim)			prim_info = (u32 *)get_property(prim, "prim-info", NULL);		if (prim_info) {			/* Other stuffs here yet unknown */			pmu_battery_count = (prim_info[6] >> 16) & 0xff;			pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART;			if (pmu_battery_count > 1)				pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;		}	}#endif /* CONFIG_PMAC_PBOOK */	/* Create /proc/pmu */	proc_pmu_root = proc_mkdir("pmu", NULL);	if (proc_pmu_root) {#ifdef CONFIG_PMAC_PBOOK		int i;		for (i=0; i<pmu_battery_count; i++) {			char title[16];			sprintf(title, "battery_%d", i);			proc_pmu_batt[i] = create_proc_read_entry(title, 0, proc_pmu_root,						proc_get_batt, (void *)i);		}#endif /* CONFIG_PMAC_PBOOK */		proc_pmu_info = create_proc_read_entry("info", 0, proc_pmu_root,					proc_get_info, NULL);		proc_pmu_irqstats = create_proc_read_entry("interrupts", 0, proc_pmu_root,					proc_get_irqstats, NULL);		proc_pmu_options = create_proc_entry("options", 0600, proc_pmu_root);		if (proc_pmu_options) {			proc_pmu_options->nlink = 1;			proc_pmu_options->read_proc = proc_read_options;			proc_pmu_options->write_proc = proc_write_options;		}	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8c8709334cec803368a432a33e0f2e116d48fe07/via-pmu.c/buggy/drivers/macintosh/via-pmu.c