summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-03 22:39:42 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-08-07 07:17:18 +0200
commit698093d68dbe7d0085103e9b2f8edfdc2b366d30 (patch)
tree3c3dfdc1c046613597372d983518b3f45745a762
parentbf802790255aa5e155effdb97fc28010ddd82c26 (diff)
downloadrtems-698093d68dbe7d0085103e9b2f8edfdc2b366d30.tar.bz2
libblock: Use rtems_blkdev_create_partition()
Update #3358.
-rw-r--r--cpukit/include/rtems/ide_part_table.h2
-rw-r--r--cpukit/libblock/src/ide_part_table.c16
2 files changed, 2 insertions, 16 deletions
diff --git a/cpukit/include/rtems/ide_part_table.h b/cpukit/include/rtems/ide_part_table.h
index 8b683b3ff5..9fd991ec5f 100644
--- a/cpukit/include/rtems/ide_part_table.h
+++ b/cpukit/include/rtems/ide_part_table.h
@@ -126,8 +126,6 @@ typedef struct rtems_part_desc_s {
typedef struct rtems_disk_desc_s {
- dev_t dev; /* device number */
-
/* device name in /dev filesystem */
char dev_name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
diff --git a/cpukit/libblock/src/ide_part_table.c b/cpukit/libblock/src/ide_part_table.c
index 58a8d87284..5d40130ea4 100644
--- a/cpukit/libblock/src/ide_part_table.c
+++ b/cpukit/libblock/src/ide_part_table.c
@@ -487,7 +487,6 @@ partition_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
}
strncpy (disk_desc->dev_name, dev_name, 15);
- disk_desc->dev = dev_stat.st_rdev;
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
RTEMS_IDE_SECTOR_SIZE;
@@ -550,10 +549,7 @@ rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
{
int part_num;
- dev_t dev;
rtems_disk_desc_t *disk_desc;
- rtems_device_major_number major;
- rtems_device_minor_number minor;
rtems_status_code rc;
rtems_part_desc_t *part_desc;
@@ -574,18 +570,10 @@ rtems_ide_part_table_initialize(const char *dev_name)
return rc;
}
- /* To avoid device numbers conflicts we have to use for logic disk the same
- * device major number as ATA device has, and minor number that equals to
- * sum of logic disk partition number and the minor number of physical disk
- */
-
- rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
-
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
{
sprintf(name, "%s%d", dev_name, part_num + 1);
- dev = rtems_filesystem_make_dev_t(major, ++minor);
part_desc = disk_desc->partitions[part_num];
if (part_desc == NULL)
@@ -593,8 +581,8 @@ rtems_ide_part_table_initialize(const char *dev_name)
continue;
}
- rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
- part_desc->size, name);
+ rc = rtems_blkdev_create_partition(name, dev_name, part_desc->start,
+ part_desc->size);
if (rc != RTEMS_SUCCESSFUL)
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);