Commit 4101f687 authored by Simon Glass's avatar Simon Glass

dm: Drop the block_dev_desc_t typedef

Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.
Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
Tested-by: default avatarStephen Warren <swarren@nvidia.com>
parent b391d743
......@@ -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,7 +103,7 @@ 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);
......@@ -148,7 +148,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,9 +166,9 @@ 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;
......@@ -308,7 +308,7 @@ 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;
......@@ -328,7 +328,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 +348,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;
......
......@@ -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 */
......
......@@ -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.
......
......@@ -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 defined(CONFIG_FIT)
const void *fit_hdr = NULL;
......
......@@ -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) {
......@@ -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;
......
......@@ -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;
......
......@@ -67,7 +67,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);
......@@ -92,7 +92,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)
......
......@@ -53,7 +53,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 +62,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 +78,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
......@@ -187,7 +187,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
......@@ -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;
......@@ -713,7 +713,7 @@ 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;
......@@ -839,7 +839,7 @@ 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;
......@@ -1301,7 +1301,7 @@ 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 */
......@@ -1394,7 +1394,7 @@ 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;
......
......@@ -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);
......
......@@ -29,7 +29,7 @@
static int do_part_uuid(int argc, char * const argv[])
{
int part;
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
disk_partition_t info;
if (argc < 2)
......@@ -52,7 +52,7 @@ static int do_part_uuid(int argc, char * const argv[])
static int do_part_list(int argc, char * const argv[])
{
int ret;
block_dev_desc_t *desc;
struct blk_desc *desc;
char *var = NULL;
bool bootable = false;
int i;
......@@ -114,7 +114,7 @@ static int do_part_list(int argc, char * const argv[])
static int do_part_start(int argc, char * const argv[])
{
block_dev_desc_t *desc;
struct blk_desc *desc;
disk_partition_t info;
char buf[512] = { 0 };
int part;
......@@ -148,7 +148,7 @@ static int do_part_start(int argc, char * const argv[])
static int do_part_size(int argc, char * const argv[])
{
block_dev_desc_t *desc;
struct blk_desc *desc;
disk_partition_t info;
char buf[512] = { 0 };
int part;
......
......@@ -15,7 +15,7 @@
int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *ep;
block_dev_desc_t *dev_desc = NULL;
struct blk_desc *dev_desc = NULL;
int dev;
int part = 0;
disk_partition_t part_info;
......@@ -57,7 +57,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
offset = part_info.start;
limit = part_info.size;
} else {
/* Largest address not available in block_dev_desc_t. */
/* Largest address not available in struct blk_desc. */
limit = ~0;
}
......
......@@ -34,7 +34,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *filename = "/";
int dev, part;
block_dev_desc_t *dev_desc=NULL;
struct blk_desc *dev_desc = NULL;
disk_partition_t info;
if (argc < 3)
......@@ -82,7 +82,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int dev, part;
ulong addr = 0, filelen;
disk_partition_t info;
block_dev_desc_t *dev_desc = NULL;
struct blk_desc *dev_desc = NULL;
unsigned long count;
char *addr_str;
......
......@@ -16,15 +16,15 @@
#include <sata.h>
static int sata_curr_device = -1;
block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
struct blk_desc sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
static unsigned long sata_bread(block_dev_desc_t *block_dev, lbaint_t start,
static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, void *dst)
{
return sata_read(block_dev->dev, start, blkcnt, dst);
}
static unsigned long sata_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, const void *buffer)
{
return sata_write(block_dev->dev, start, blkcnt, buffer);
......@@ -36,7 +36,7 @@ int __sata_initialize(void)
int i;
for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc));
memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
sata_dev_desc[i].if_type = IF_TYPE_SATA;
sata_dev_desc[i].dev = i;
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
......@@ -75,7 +75,7 @@ __weak int __sata_stop(void)
int sata_stop(void) __attribute__((weak, alias("__sata_stop")));
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *sata_get_dev(int dev)
struct blk_desc *sata_get_dev(int dev)
{
return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
}
......
......@@ -48,7 +48,7 @@ static int scsi_max_devs; /* number of highest available scsi device */
static int scsi_curr_dev; /* current device */
static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
/********************************************************************************
* forward declerations of some Setup Routines
......@@ -66,9 +66,9 @@ void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
unsigned long *blksz);
static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer);
......@@ -239,7 +239,7 @@ void scsi_init(void)
#endif
#ifdef CONFIG_PARTITIONS
block_dev_desc_t * scsi_get_dev(int dev)
struct blk_desc *scsi_get_dev(int dev)
{
return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
}
......@@ -376,7 +376,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#define SCSI_MAX_READ_BLK 0xFFFF
#define SCSI_LBA48_READ 0xFFFFFFF
static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer)
{
int device = block_dev->dev;
......@@ -443,7 +443,7 @@ static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
/* Almost the maximum amount of the scsi_ext command.. */
#define SCSI_MAX_WRITE_BLK 0xFFFF
static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer)
{
int device = block_dev->dev;
......
......@@ -43,7 +43,7 @@ U_BOOT_CMD(
static int do_gzwrite(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
block_dev_desc_t *bdev;
struct blk_desc *bdev;
int ret;
unsigned char *addr;
unsigned long length;
......
......@@ -625,7 +625,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int i;
extern char usb_started;
#ifdef CONFIG_USB_STORAGE
block_dev_desc_t *stor_dev;
struct blk_desc *stor_dev;
#endif
if (argc < 2)
......
......@@ -19,7 +19,7 @@
static int ums_read_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, void *buf)
{
block_dev_desc_t *block_dev = &ums_dev->block_dev;
struct blk_desc *block_dev = &ums_dev->block_dev;
lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
......@@ -28,7 +28,7 @@ static int ums_read_sector(struct ums *ums_dev,
static int ums_write_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, const void *buf)
{
block_dev_desc_t *block_dev = &ums_dev->block_dev;
struct blk_desc *block_dev = &ums_dev->block_dev;
lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
......@@ -53,7 +53,7 @@ static void ums_fini(void)
static int ums_init(const char *devtype, const char *devnums)
{
char *s, *t, *devnum, *name;
block_dev_desc_t *block_dev;
struct blk_desc *block_dev;
int ret;
struct ums *ums_new;
......
......@@ -39,7 +39,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
int part;
ulong addr = 0;
disk_partition_t info;
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
char buf[12];
unsigned long count;
const char *addr_str;
......@@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
const char *filename = "/";
int part;
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
disk_partition_t info;
struct device_s vdev;
......
......@@ -38,7 +38,7 @@ int env_init(void)
int saveenv(void)
{
env_t env_new;
block_dev_desc_t *dev_desc = NULL;
struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev, part;
int err;
......@@ -77,7 +77,7 @@ int saveenv(void)
void env_relocate_spec(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
block_dev_desc_t *dev_desc = NULL;
struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev, part;
int err;
......
......@@ -22,10 +22,10 @@
static char *response_str;
struct fb_mmc_sparse {
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
};
static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc,
static int get_partition_info_efi_by_name_or_alias(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info)
{
int ret;
......@@ -55,7 +55,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
char *data)
{
struct fb_mmc_sparse *sparse = priv;
block_dev_desc_t *dev_desc = sparse->dev_desc;
struct blk_desc *dev_desc = sparse->dev_desc;
int ret;
ret = dev_desc->block_write(dev_desc, offset, size, data);
......@@ -65,7 +65,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
return ret;
}
static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info,
static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
const char *part_name, void *buffer,
unsigned int download_bytes)
{
......@@ -100,7 +100,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
void *download_buffer, unsigned int download_bytes,
char *response)
{
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
disk_partition_t info;
/* initialize the response buffer */
......@@ -165,7 +165,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
void fb_mmc_erase(const char *cmd, char *response)
{
int ret;
block_dev_desc_t *dev_desc;
struct blk_desc *dev_desc;
disk_partition_t info;
lbaint_t blks, blks_start, blks_size, grp_size;
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
......
......@@ -10,7 +10,7 @@
#include <image.h>
#ifdef CONFIG_SPL_EXT_SUPPORT
int spl_load_image_ext(block_dev_desc_t *block_dev,
int spl_load_image_ext(struct blk_desc *block_dev,
int partition,
const char *filename)
{
......@@ -64,7 +64,7 @@ end:
}
#ifdef CONFIG_SPL_OS_BOOT
int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
{
int err;
__maybe_unused loff_t filelen, actlen;
......@@ -137,7 +137,7 @@ defaults:
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#else
int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
{
return -ENOSYS;
}
......
......@@ -19,7 +19,7 @@
static int fat_registered;
#ifdef CONFIG_SPL_FAT_SUPPORT
static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
{
int err = 0;
......@@ -39,7 +39,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
return err;
}
int spl_load_image_fat(block_dev_desc_t *block_dev,
int spl_load_image_fat(struct blk_desc *block_dev,
int partition,
const char *filename)
{
......@@ -72,7 +72,7 @@ end:
}
#ifdef CONFIG_SPL_OS_BOOT
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
{
int err;
__maybe_unused char *file;
......@@ -121,7 +121,7 @@ defaults:
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#else
int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
{
return -ENOSYS;
}
......
......@@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
int spl_sata_load_image(void)
{
int err;
block_dev_desc_t *stor_dev;
struct blk_desc *stor_dev;
err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
if (err) {
......
......@@ -25,7 +25,7 @@ static int usb_stor_curr_dev = -1; /* current device */
int spl_usb_load_image(void)
{
int err;
block_dev_desc_t *stor_dev;
struct blk_desc *stor_dev;
usb_stop();
err = usb_init();
......
......@@ -67,7 +67,7 @@ static __u32 CBWTag;
static int usb_max_devs; /* number of highest available usb device */
static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV];
struct us_data;
typedef int (*trans_cmnd)(ccb *cb, struct us_data *data);
......@@ -115,17 +115,17 @@ static struct us_data usb_stor[USB_MAX_STOR_DEV];
#define USB_STOR_TRANSPORT_ERROR -2
int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
block_dev_desc_t *dev_desc);
struct blk_desc *dev_desc);
int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct us_data *ss);
static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer);
void uhci_show_temp_int_td(void);
#ifdef CONFIG_PARTITIONS
block_dev_desc_t *usb_stor_get_dev(int index)
struct blk_desc *usb_stor_get_dev(int index)
{
return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL;
}
......@@ -187,10 +187,10 @@ static int usb_stor_probe_device(struct usb_device *dev)
for (lun = 0;
lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
lun++) {
struct block_dev_desc *blkdev;
struct blk_desc *blkdev;
blkdev = &usb_dev_desc[usb_max_devs];
memset(blkdev, '\0', sizeof(block_dev_desc_t));
memset(blkdev, '\0', sizeof(struct blk_desc));
blkdev->if_type = IF_TYPE_USB;
blkdev->dev = usb_max_devs;
blkdev->part_type = PART_TYPE_UNKNOWN;
......@@ -1011,7 +1011,7 @@ static int usb_write_10(ccb *srb, struct us_data *ss, unsigned long start,
* device with proper values (as reported by 'usb info').
*
* Vendor and product length limits are taken from the definition of
* block_dev_desc_t in include/part.h.
* struct blk_desc in include/part.h.
*/
static void usb_bin_fixup(struct usb_device_descriptor descriptor,
unsigned char vendor[],
......@@ -1026,7 +1026,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor,
}
#endif /* CONFIG_USB_BIN_FIXUP */
static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer)
{
int device = block_dev->dev;
......@@ -1097,7 +1097,7 @@ retry_it:
return blkcnt;
}
static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer)
{
int device = block_dev->dev;
......@@ -1289,7 +1289,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
}
int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
block_dev_desc_t *dev_desc)
struct blk_desc *dev_desc)
{
unsigned char perq, modi;
ALLOC_CACHE_ALIGN_BUFFER(u32, cap, 2);
......
......@@ -22,7 +22,7 @@
struct block_drvr {
char *name;
block_dev_desc_t* (*get_dev)(int dev);
struct blk_desc* (*get_dev)(int dev);
int (*select_hwpart)(int dev_num, int hwpart);
};
......@@ -58,10 +58,10 @@ static const struct block_drvr block_drvr[] = {
DECLARE_GLOBAL_DATA_PTR;
#ifdef HAVE_BLOCK_DEVICE
static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
{
const struct block_drvr *drvr = block_drvr;
block_dev_desc_t* (*reloc_get_dev)(int dev);
struct blk_desc* (*reloc_get_dev)(int dev);