/* The memory resource for the UMC device is acquired and the device registered with the system.  */
int umc_device_register(struct umc_dev *umc)
/* The memory resource for the UMC device is acquired and the device registered with the system.  */
int umc_device_register(struct umc_dev *umc)
{
	int err;
	err = request_resource(umc->resource.parent, &umc->resource);
	if (err < 0) {
		dev_err(&umc->dev, "can't allocate resource range "
			"%016Lx to %016Lx: %d\n",
			(unsigned long long)umc->resource.start,
			(unsigned long long)umc->resource.end,
			err);
		goto error_request_resource;
	}
	err = device_register(&umc->dev);
	if (err < 0)
		goto error_device_register;
	return 0;
error_device_register:
	release_resource(&umc->resource);
error_request_resource:
	return err;
}