rdev->dev.dma_mask = (u64 *) 0xffffffff; rdev->dev.coherent_dma_mask = 0xffffffffULL; 
rdev->dma_mask = DMA_32BIT_MASK; rdev->dev.dma_mask = &rdev->dma_mask; rdev->dev.coherent_dma_mask = DMA_32BIT_MASK; 
static struct rio_dev *rio_setup_device(struct rio_net *net,					struct rio_mport *port, u16 destid,					u8 hopcount, int do_enum){	struct rio_dev *rdev;	struct rio_switch *rswitch;	int result, rdid;	rdev = kmalloc(sizeof(struct rio_dev), GFP_KERNEL);	if (!rdev)		goto out;	memset(rdev, 0, sizeof(struct rio_dev));	rdev->net = net;	rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_ID_CAR,				 &result);	rdev->did = result >> 16;	rdev->vid = result & 0xffff;	rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_INFO_CAR,				 &rdev->device_rev);	rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_ID_CAR,				 &result);	rdev->asm_did = result >> 16;	rdev->asm_vid = result & 0xffff;	rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_INFO_CAR,				 &result);	rdev->asm_rev = result >> 16;	rio_mport_read_config_32(port, destid, hopcount, RIO_PEF_CAR,				 &rdev->pef);	if (rdev->pef & RIO_PEF_EXT_FEATURES)		rdev->efptr = result & 0xffff;	rio_mport_read_config_32(port, destid, hopcount, RIO_SRC_OPS_CAR,				 &rdev->src_ops);	rio_mport_read_config_32(port, destid, hopcount, RIO_DST_OPS_CAR,				 &rdev->dst_ops);	if (rio_device_has_destid(port, rdev->src_ops, rdev->dst_ops)	    && do_enum) {		rio_set_device_id(port, destid, hopcount, next_destid);		rdev->destid = next_destid++;		if (next_destid == port->host_deviceid)			next_destid++;	} else		rdev->destid = rio_get_device_id(port, destid, hopcount);	/* If a PE has both switch and other functions, show it as a switch */	if (rio_is_switch(rdev)) {		rio_mport_read_config_32(port, destid, hopcount,					 RIO_SWP_INFO_CAR, &rdev->swpinfo);		rswitch = kmalloc(sizeof(struct rio_switch), GFP_KERNEL);		if (!rswitch) {			kfree(rdev);			rdev = NULL;			goto out;		}		rswitch->switchid = next_switchid;		rswitch->hopcount = hopcount;		rswitch->destid = 0xffff;		/* Initialize switch route table */		for (rdid = 0; rdid < RIO_MAX_ROUTE_ENTRIES; rdid++)			rswitch->route_table[rdid] = RIO_INVALID_ROUTE;		rdev->rswitch = rswitch;		sprintf(rio_name(rdev), "%02x:s:%04x", rdev->net->id,			rdev->rswitch->switchid);		rio_route_set_ops(rdev);		list_add_tail(&rswitch->node, &rio_switches);	} else		sprintf(rio_name(rdev), "%02x:e:%04x", rdev->net->id,			rdev->destid);	rdev->dev.bus = &rio_bus_type;	device_initialize(&rdev->dev);	rdev->dev.release = rio_release_dev;	rio_dev_get(rdev);	rdev->dev.dma_mask = (u64 *) 0xffffffff;	rdev->dev.coherent_dma_mask = 0xffffffffULL;	if ((rdev->pef & RIO_PEF_INB_DOORBELL) &&	    (rdev->dst_ops & RIO_DST_OPS_DOORBELL))		rio_init_dbell_res(&rdev->riores[RIO_DOORBELL_RESOURCE],				   0, 0xffff);	rio_add_device(rdev);      out:	return rdev;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fa78cc51794912b7e6ee98cd823fcc84cf79d04a/rio-scan.c/clean/drivers/rapidio/rio-scan.c