of_node_put(np); 
int smu_init (void){	struct device_node *np;	u32 *data;        np = of_find_node_by_type(NULL, "smu");        if (np == NULL)		return -ENODEV;	if (smu_cmdbuf_abs == 0) {		printk(KERN_ERR "SMU: Command buffer not allocated !\n");		return -EINVAL;	}	smu = alloc_bootmem(sizeof(struct smu_device));	if (smu == NULL)		return -ENOMEM;	memset(smu, 0, sizeof(*smu));	spin_lock_init(&smu->lock);	smu->of_node = np;	/* smu_cmdbuf_abs is in the low 2G of RAM, can be converted to a	 * 32 bits value safely	 */	smu->cmd_buf_abs = (u32)smu_cmdbuf_abs;	smu->cmd_buf = (struct smu_cmd_buf *)abs_to_virt(smu_cmdbuf_abs);	np = of_find_node_by_name(NULL, "smu-doorbell");	if (np == NULL) {		printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n");		goto fail;	}	data = (u32 *)get_property(np, "reg", NULL);	of_node_put(np);	if (data == NULL) {		printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n");		goto fail;	}	/* Current setup has one doorbell GPIO that does both doorbell	 * and ack. GPIOs are at 0x50, best would be to find that out	 * in the device-tree though.	 */	smu->db_req = 0x50 + *data;	smu->db_ack = 0x50 + *data;	/* Doorbell buffer is currently hard-coded, I didn't find a proper	 * device-tree entry giving the address. Best would probably to use	 * an offset for K2 base though, but let's do it that way for now.	 */	smu->db_buf = ioremap(0x8000860c, 0x1000);	if (smu->db_buf == NULL) {		printk(KERN_ERR "SMU: Can't map doorbell buffer pointer !\n");		goto fail;	}	sys_ctrler = SYS_CTRLER_SMU;	return 0; fail:	smu = NULL;	return -ENXIO;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/0365ba7fb1fa94a41289d6a3d36b4d95960e56cc/smu.c/clean/drivers/macintosh/smu.c