Commit 88033d73 authored by Tom Rini's avatar Tom Rini
parents 9f0f432c 608e399f
......@@ -189,7 +189,7 @@ static int API_get_timer(va_list ap)
*
* - net: &eth_device struct address from list pointed to by eth_devices
*
* - storage: block_dev_desc_t struct address from &ide_dev_desc[n],
* - storage: struct blk_desc struct address from &ide_dev_desc[n],
* &scsi_dev_desc[n] and similar tables
*
****************************************************************************/
......
......@@ -103,10 +103,10 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
int i;
block_dev_desc_t *dd;
struct blk_desc *dd;
if (first) {
di->cookie = (void *)get_dev(specs[type].name, 0);
di->cookie = (void *)blk_get_dev(specs[type].name, 0);
if (di->cookie == NULL)
return 0;
else
......@@ -119,7 +119,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
} else {
for (i = 0; i < specs[type].max_dev; i++)
if (di->cookie == (void *)get_dev(specs[type].name, i)) {
if (di->cookie ==
(void *)blk_get_dev(specs[type].name, i)) {
/* previous cookie found -- advance to the
* next device, if possible */
......@@ -129,7 +130,8 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
break;
}
di->cookie = (void *)get_dev(specs[type].name, i);
di->cookie = (void *)blk_get_dev(
specs[type].name, i);
if (di->cookie == NULL)
return 0;
else
......@@ -148,7 +150,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
di->type = specs[type].type;
if (di->cookie != NULL) {
dd = (block_dev_desc_t *)di->cookie;
dd = (struct blk_desc *)di->cookie;
if (dd->type == DEV_TYPE_UNKNOWN) {
debugf("device instance exists, but is not active..");
found = 0;
......@@ -166,15 +168,15 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
/*
* returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t
* returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc
*/
static int dev_stor_type(block_dev_desc_t *dd)
static int dev_stor_type(struct blk_desc *dd)
{
int i, j;
for (i = ENUM_IDE; i < ENUM_MAX; i++)
for (j = 0; j < specs[i].max_dev; j++)
if (dd == get_dev(specs[i].name, j))
if (dd == blk_get_dev(specs[i].name, j))
return i;
return ENUM_MAX;
......@@ -308,12 +310,12 @@ int dev_enum_storage(struct device_info *di)
return 0;
}
static int dev_stor_is_valid(int type, block_dev_desc_t *dd)
static int dev_stor_is_valid(int type, struct blk_desc *dd)
{
int i;
for (i = 0; i < specs[type].max_dev; i++)
if (dd == get_dev(specs[type].name, i))
if (dd == blk_get_dev(specs[type].name, i))
if (dd->type != DEV_TYPE_UNKNOWN)
return 1;
......@@ -328,7 +330,7 @@ int dev_open_stor(void *cookie)
if (type == ENUM_MAX)
return API_ENODEV;
if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie))
if (dev_stor_is_valid(type, (struct blk_desc *)cookie))
return 0;
return API_ENODEV;
......@@ -348,7 +350,7 @@ int dev_close_stor(void *cookie)
lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
{
int type;
block_dev_desc_t *dd = (block_dev_desc_t *)cookie;
struct blk_desc *dd = (struct blk_desc *)cookie;
if ((type = dev_stor_type(dd)) == ENUM_MAX)
return 0;
......
......@@ -756,7 +756,7 @@ static int veyron_init(struct dram_info *priv)
struct udevice *pmic;
int ret;
ret = uclass_first_device(UCLASS_PMIC, &pmic);
ret = uclass_first_device_err(UCLASS_PMIC, &pmic);
if (ret)
return ret;
......
......@@ -63,11 +63,9 @@ int arch_cpu_init_dm(void)
struct udevice *dev;
int ret;
ret = uclass_first_device(UCLASS_CPU, &dev);
ret = uclass_first_device_err(UCLASS_CPU, &dev);
if (ret)
return ret;
if (!dev)
return -ENODEV;
gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
#ifndef CONFIG_ROM_STUBS
......
......@@ -249,7 +249,7 @@ int interrupt_init(void)
int ret;
/* Try to set up the interrupt router, but don't require one */
ret = uclass_first_device(UCLASS_IRQ, &dev);
ret = uclass_first_device_err(UCLASS_IRQ, &dev);
if (ret && ret != -ENODEV)
return ret;
......
......@@ -104,9 +104,9 @@ int arch_cpu_init_dm(void)
/* TODO(sjg@chromium.org): Get rid of gd->hose */
gd->hose = hose;
ret = uclass_first_device(UCLASS_LPC, &dev);
if (!dev)
return -ENODEV;
ret = uclass_first_device_err(UCLASS_LPC, &dev);
if (ret)
return ret;
/*
* We should do as little as possible before the serial console is
......@@ -210,11 +210,9 @@ int print_cpuinfo(void)
/* Early chipset init required before RAM init can work */
uclass_first_device(UCLASS_NORTHBRIDGE, &dev);
ret = uclass_first_device(UCLASS_LPC, &lpc);
ret = uclass_first_device_err(UCLASS_LPC, &lpc);
if (ret)
return ret;
if (!dev)
return -ENODEV;
/* Cause the SATA device to do its early init */
uclass_first_device(UCLASS_DISK, &dev);
......@@ -236,11 +234,9 @@ int print_cpuinfo(void)
post_code(POST_EARLY_INIT);
/* Enable SPD ROMs and DDR-III DRAM */
ret = uclass_first_device(UCLASS_I2C, &dev);
ret = uclass_first_device_err(UCLASS_I2C, &dev);
if (ret)
return ret;
if (!dev)
return -ENODEV;
/* Prepare USB controller early in S3 resume */
if (boot_mode == PEI_BOOT_RESUME)
......
......@@ -812,9 +812,9 @@ int gma_func0_init(struct udevice *dev)
writew(0x0010, RCB_REG(DISPBDF));
setbits_le32(RCB_REG(FD2), PCH_ENABLE_DBDF);
ret = uclass_first_device(UCLASS_NORTHBRIDGE, &nbridge);
if (!nbridge)
return -ENODEV;
ret = uclass_first_device_err(UCLASS_NORTHBRIDGE, &nbridge);
if (ret)
return ret;
rev = bridge_silicon_revision(nbridge);
sandybridge_setup_graphics(nbridge, dev);
......
......@@ -229,11 +229,9 @@ static int bd82x6x_sata_probe(struct udevice *dev)
struct udevice *pch;
int ret;
ret = uclass_first_device(UCLASS_PCH, &pch);
ret = uclass_first_device_err(UCLASS_PCH, &pch);
if (ret)
return ret;
if (!pch)
return -ENODEV;
if (!(gd->flags & GD_FLG_RELOC))
bd82x6x_sata_enable(dev);
......
......@@ -736,11 +736,9 @@ int dram_init(void)
struct udevice *dev, *me_dev;
int ret;
ret = uclass_first_device(UCLASS_NORTHBRIDGE, &dev);
ret = uclass_first_device_err(UCLASS_NORTHBRIDGE, &dev);
if (ret)
return ret;
if (!dev)
return -ENODEV;
ret = syscon_get_by_driver_data(X86_SYSCON_ME, &me_dev);
if (ret)
return ret;
......
......@@ -297,7 +297,7 @@ static int mptable_add_intsrc(struct mp_config_table *mc,
const u32 *cell;
int i, ret;
ret = uclass_first_device(UCLASS_IRQ, &dev);
ret = uclass_first_device_err(UCLASS_IRQ, &dev);
if (ret && ret != -ENODEV) {
debug("%s: Cannot find irq router node\n", __func__);
return ret;
......
......@@ -81,7 +81,7 @@ static int load_rescue_image(ulong addr)
char dev[7];
char addr_str[16];
char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
block_dev_desc_t *stor_dev = NULL;
struct blk_desc *stor_dev = NULL;
cmd_tbl_t *bcmd;
/* Get name of firmware directory */
......@@ -117,7 +117,7 @@ static int load_rescue_image(ulong addr)
/* Detect partition */
for (partno = -1, i = 0; i < 6; i++) {
if (get_partition_info(stor_dev, i, &info) == 0) {
if (part_get_info(stor_dev, i, &info) == 0) {
if (fat_register_device(stor_dev, i) == 0) {
/* Check if rescue image is present */
FW_DEBUG("Looking for firmware directory '%s'"
......
......@@ -217,8 +217,8 @@ Added files:
Block device changes:
---------------------
To allow the use of dos_part.c, mac_part.c and iso_part.c, the parameter
block_dev_desc will be used when accessing the functions in these files. The block
device descriptor (block_dev_desc) contains a pointer to the read routine of the
blk_desc will be used when accessing the functions in these files. The block
device descriptor (blk_desc) contains a pointer to the read routine of the
device, which will be used to read blocks from the device.
Renamed function ide_print to dev_print and moved it to the file disk/part.c to use
it for IDE ATAPI and SCSI devices.
......
......@@ -337,8 +337,8 @@ int board_mmc_init(bd_t *bis)
if (!sunxi_mmc_has_egon_boot_signature(mmc0) &&
sunxi_mmc_has_egon_boot_signature(mmc1)) {
/* Booting from emmc / mmc2, swap */
mmc0->block_dev.dev = 1;
mmc1->block_dev.dev = 0;
mmc0->block_dev.devnum = 1;
mmc1->block_dev.devnum = 0;
}
#endif
......
......@@ -246,18 +246,14 @@ int bmp_display(ulong addr, int x, int y)
addr = map_to_sysmem(bmp);
#ifdef CONFIG_DM_VIDEO
ret = uclass_first_device(UCLASS_VIDEO, &dev);
ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
if (!ret) {
if (!dev)
ret = -ENODEV;
if (!ret) {
bool align = false;
bool align = false;
# ifdef CONFIG_SPLASH_SCREEN_ALIGN
align = true;
align = true;
# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
ret = video_bmp_display(dev, addr, x, y, align);
}
ret = video_bmp_display(dev, addr, x, y, align);
}
#elif defined(CONFIG_LCD)
ret = lcd_display_bitmap(addr, x, y);
......
......@@ -103,7 +103,7 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
printf(" size type name\n");
printf("------------------------------------------\n");
while (file) {
u32 type = file_cbfs_type(file);
int type = file_cbfs_type(file);
char *type_name = NULL;
const char *filename = file_cbfs_name(file);
......@@ -140,7 +140,8 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
case CBFS_COMPONENT_CMOS_LAYOUT:
type_name = "cmos layout";
break;
case -1UL:
case -1:
case 0:
type_name = "null";
break;
}
......
......@@ -29,7 +29,6 @@
# define DEBUGF(fmt, args...)
#endif
#ifdef CONFIG_CRAMFS_CMDLINE
#include <flash.h>
#ifdef CONFIG_SYS_NO_FLASH
......@@ -201,7 +200,3 @@ U_BOOT_CMD(
"[ directory ]\n"
" - list files in a directory.\n"
);
#endif /* #ifdef CONFIG_CRAMFS_CMDLINE */
/***************************************************/
......@@ -20,7 +20,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
image_header_t *hdr;
#endif
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
#if CONFIG_IS_ENABLED(FIT)
const void *fit_hdr = NULL;
......@@ -38,14 +38,14 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
part = get_device_and_partition(intf, (argc == 3) ? argv[2] : NULL,
part = blk_get_device_part_str(intf, (argc == 3) ? argv[2] : NULL,
&dev_desc, &info, 1);
if (part < 0) {
bootstage_error(BOOTSTAGE_ID_IDE_TYPE);
return 1;
}
dev = dev_desc->dev;
dev = dev_desc->devnum;
bootstage_mark(BOOTSTAGE_ID_IDE_TYPE);
printf("\nLoading from %s device %d, partition %d: "
......@@ -56,7 +56,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
", Block Size: %ld\n",
info.start, info.size, info.blksz);
if (dev_desc->block_read(dev_desc, info.start, 1, (ulong *)addr) != 1) {
if (blk_dread(dev_desc, info.start, 1, (ulong *)addr) != 1) {
printf("** Read error on %d:%d\n", dev, part);
bootstage_error(BOOTSTAGE_ID_IDE_PART_READ);
return 1;
......@@ -100,8 +100,8 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
cnt /= info.blksz;
cnt -= 1;
if (dev_desc->block_read(dev_desc, info.start + 1, cnt,
(ulong *)(addr + info.blksz)) != cnt) {
if (blk_dread(dev_desc, info.start + 1, cnt,
(ulong *)(addr + info.blksz)) != cnt) {
printf("** Read error on %d:%d\n", dev, part);
bootstage_error(BOOTSTAGE_ID_IDE_READ);
return 1;
......
......@@ -69,7 +69,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
int dev, part;
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
disk_partition_t info;
if (argc < 2) {
......@@ -77,11 +77,11 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
return 0;
}
part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info, 1);
part = blk_get_device_part_str(argv[1], argv[2], &dev_desc, &info, 1);
if (part < 0)
return 1;
dev = dev_desc->dev;
dev = dev_desc->devnum;
if (fat_set_blk_dev(dev_desc, &info) != 0) {
printf("\n** Unable to use %s %d:%d for fatinfo **\n",
argv[1], dev, part);
......@@ -105,7 +105,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
int ret;
unsigned long addr;
unsigned long count;
block_dev_desc_t *dev_desc = NULL;
struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev = 0;
int part = 1;
......@@ -114,11 +114,11 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
if (argc < 5)
return cmd_usage(cmdtp);
part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info, 1);
part = blk_get_device_part_str(argv[1], argv[2], &dev_desc, &info, 1);
if (part < 0)
return 1;
dev = dev_desc->dev;
dev = dev_desc->devnum;
if (fat_set_blk_dev(dev_desc, &info) != 0) {
printf("\n** Unable to use %s %d:%d for fatwrite **\n",
......
......@@ -168,7 +168,7 @@ static bool found_key(const char *str, const char *key)
* @return - zero on success, otherwise error
*
*/
static int set_gpt_info(block_dev_desc_t *dev_desc,
static int set_gpt_info(struct blk_desc *dev_desc,
const char *str_part,
char **str_disk_guid,
disk_partition_t **partitions,
......@@ -328,7 +328,7 @@ err:
return errno;
}
static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
{
int ret;
char *str_disk_guid;
......@@ -356,7 +356,7 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
return ret;
}
static int gpt_verify(block_dev_desc_t *blk_dev_desc, const char *str_part)
static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
blk_dev_desc->blksz);
......@@ -408,7 +408,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int ret = CMD_RET_SUCCESS;
int dev = 0;
char *ep;
block_dev_desc_t *blk_dev_desc = NULL;
struct blk_desc *blk_dev_desc = NULL;
if (argc < 4 || argc > 5)
return CMD_RET_USAGE;
......@@ -418,7 +418,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("'%s' is not a number\n", argv[3]);
return CMD_RET_USAGE;
}
blk_dev_desc = get_dev(argv[2], dev);
blk_dev_desc = blk_get_dev(argv[2], dev);
if (!blk_dev_desc) {
printf("%s: %s dev %d NOT available\n",
__func__, argv[2], dev);
......
......@@ -5,6 +5,7 @@
*/
#include <common.h>
#include <dm.h>
#include <fs.h>
#include <part.h>
#include <sandboxblockdev.h>
......@@ -67,7 +68,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
int dev;
printf("%3s %12s %s\n", "dev", "blocks", "path");
for (dev = min_dev; dev <= max_dev; dev++) {
block_dev_desc_t *blk_dev;
struct blk_desc *blk_dev;
int ret;
printf("%3d ", dev);
......@@ -80,7 +81,13 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
continue;
}
struct host_block_dev *host_dev = blk_dev->priv;
struct host_block_dev *host_dev;
#ifdef CONFIG_BLK
host_dev = dev_get_priv(blk_dev->bdev);
#else
host_dev = blk_dev->priv;
#endif
printf("%12lu %s\n", (unsigned long)blk_dev->lba,
host_dev->filename);
}
......@@ -92,7 +99,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
{
int dev;
char *ep;
block_dev_desc_t *blk_dev;
struct blk_desc *blk_dev;
int ret;
if (argc < 1 || argc > 3)
......
......@@ -10,6 +10,7 @@
*/
#include <common.h>
#include <blk.h>
#include <config.h>
#include <watchdog.h>
#include <command.h>
......@@ -53,7 +54,7 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = {
static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS];
block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
struct blk_desc ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_IDE_RESET
......@@ -62,7 +63,7 @@ static void ide_reset (void);
#define ide_reset() /* dummy */
#endif
static void ide_ident (block_dev_desc_t *dev_desc);
static void ide_ident(struct blk_desc *dev_desc);
static uchar ide_wait (int dev, ulong t);
#define IDE_TIME_OUT 2000 /* 2 sec timeout */
......@@ -78,8 +79,8 @@ static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len
#endif
#ifdef CONFIG_ATAPI
static void atapi_inquiry(block_dev_desc_t *dev_desc);
static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
static void atapi_inquiry(struct blk_desc *dev_desc);
static ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
#endif
......@@ -137,7 +138,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
++ok;
if (dev)
putc('\n');
print_part(&ide_dev_desc[dev]);
part_print(&ide_dev_desc[dev]);
}
}
if (!ok) {
......@@ -171,7 +172,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
int dev = (int) simple_strtoul(argv[2], NULL, 10);
if (ide_dev_desc[dev].part_type != PART_TYPE_UNKNOWN) {
print_part(&ide_dev_desc[dev]);
part_print(&ide_dev_desc[dev]);
} else {
printf("\nIDE device %d not available\n",
dev);
......@@ -187,7 +188,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (strcmp(argv[1], "read") == 0) {
ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong cnt = simple_strtoul(argv[4], NULL, 16);
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
ulong n;
#ifdef CONFIG_SYS_64BIT_LBA
......@@ -203,8 +204,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
#endif
dev_desc = &ide_dev_desc[curr_device];
n = dev_desc->block_read(dev_desc, blk, cnt,
(ulong *)addr);
n = blk_dread(dev_desc, blk, cnt, (ulong *)addr);
/* flush cache after read */
flush_cache(addr,
cnt * ide_dev_desc[curr_device].blksz);
......@@ -418,7 +418,7 @@ void ide_init(void)
int led = (IDE_BUS(i) == 0) ? LED_IDE1 : LED_IDE2;
ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
ide_dev_desc[i].if_type = IF_TYPE_IDE;
ide_dev_desc[i].dev = i;
ide_dev_desc[i].devnum = i;
ide_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
ide_dev_desc[i].blksz = 0;
ide_dev_desc[i].log2blksz =
......@@ -435,7 +435,7 @@ void ide_init(void)
if ((ide_dev_desc[i].lba > 0) && (ide_dev_desc[i].blksz > 0)) {
/* initialize partition type */
init_part(&ide_dev_desc[i]);
part_init(&ide_dev_desc[i]);
if (curr_device < 0)
curr_device = i;
}
......@@ -446,7 +446,7 @@ void ide_init(void)
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *ide_get_dev(int dev)
struct blk_desc *ide_get_dev(int dev)
{
return (dev < CONFIG_SYS_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL;
}
......@@ -541,7 +541,7 @@ __weak void ide_input_data(int dev, ulong *sect_buf, int words)
/* -------------------------------------------------------------------------
*/
static void ide_ident(block_dev_desc_t *dev_desc)
static void ide_ident(struct blk_desc *dev_desc)
{
unsigned char c;
hd_driveid_t iop;
......@@ -551,7 +551,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
#endif
int device;
device = dev_desc->dev;
device = dev_desc->devnum;
printf(" Device %d: ", device);
ide_led(DEVICE_LED(device), 1); /* LED on */
......@@ -713,10 +713,10 @@ static void ide_ident(block_dev_desc_t *dev_desc)
/* ------------------------------------------------------------------------- */
ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
int device = block_dev->dev;
int device = block_dev->devnum;
ulong n = 0;
unsigned char c;
unsigned char pwrsave = 0; /* power save */
......@@ -839,10 +839,10 @@ IDE_READ_E:
/* ------------------------------------------------------------------------- */
ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
const void *buffer)
{
int device = block_dev->dev;
int device = block_dev->devnum;
ulong n = 0;
unsigned char c;
......@@ -1301,14 +1301,14 @@ error:
}
static void atapi_inquiry(block_dev_desc_t *dev_desc)
static void atapi_inquiry(struct blk_desc *dev_desc)
{
unsigned char ccb[12]; /* Command descriptor block */
unsigned char iobuf[64]; /* temp buf */
unsigned char c;
int device;
device = dev_desc->dev;
device = dev_desc->devnum;
dev_desc->type = DEV_TYPE_UNKNOWN; /* not yet valid */
dev_desc->block_read = atapi_read;
......@@ -1394,10 +1394,10 @@ static void atapi_inquiry(block_dev_desc_t *dev_desc)
#define ATAPI_READ_BLOCK_SIZE 2048 /* assuming CD part */
#define ATAPI_READ_MAX_BLOCK (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)
ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
int device = block_dev->dev;
int device = block_dev->devnum;
ulong n = 0;
unsigned char ccb[12]; /* Command descriptor block */
ulong cnt;
......
......@@ -424,7 +424,7 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
block_dev_desc_t *mmc_dev;
struct blk_desc *mmc_dev;
struct mmc *mmc;
mmc = init_mmc_device(curr_device, false);
......@@ -433,7 +433,7 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
mmc_dev = mmc_get_dev(curr_device);
if (mmc_dev != NULL && mmc_dev->type != DEV_TYPE_UNKNOWN) {
print_part(mmc_dev);
part_print(mmc_dev);
return CMD_RET_SUCCESS;
}
......
......@@ -72,8 +72,8 @@ static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("Failed to create MMC Device\n");
return 1;
}
printf("%s: %d at %u:%u hz %u mode %u\n", mmc->cfg->name, mmc->block_dev.dev,
bus, cs, speed, mode);
printf("%s: %d at %u:%u hz %u mode %u\n", mmc->cfg->name,
mmc->block_dev.devnum, bus, cs, speed, mode);
mmc_init(mmc);
return 0;
......
......@@ -29,7 +29,7 @@
static int do_part_uuid(int argc, char * const argv[])
{
int part;
block_dev_desc_t *dev_desc;