Skip to content

Commit

Permalink
ide: remove ide_{,un}register_region
Browse files Browse the repository at this point in the history
There is no need to ever register the fake gendisk used for ide-tape.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Nov 16, 2020
1 parent a160c61 commit d18e8b1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
32 changes: 0 additions & 32 deletions drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,38 +929,6 @@ static struct kobject *ata_probe(dev_t dev, int *part, void *data)
return NULL;
}

static struct kobject *exact_match(dev_t dev, int *part, void *data)
{
struct gendisk *p = data;
*part &= (1 << PARTN_BITS) - 1;
return &disk_to_dev(p)->kobj;
}

static int exact_lock(dev_t dev, void *data)
{
struct gendisk *p = data;

if (!get_disk_and_module(p))
return -1;
return 0;
}

void ide_register_region(struct gendisk *disk)
{
blk_register_region(MKDEV(disk->major, disk->first_minor),
disk->minors, NULL, exact_match, exact_lock, disk);
}

EXPORT_SYMBOL_GPL(ide_register_region);

void ide_unregister_region(struct gendisk *disk)
{
blk_unregister_region(MKDEV(disk->major, disk->first_minor),
disk->minors);
}

EXPORT_SYMBOL_GPL(ide_unregister_region);

void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
Expand Down
2 changes: 0 additions & 2 deletions drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,6 @@ static void ide_tape_remove(ide_drive_t *drive)

ide_proc_unregister_driver(drive, tape->driver);
device_del(&tape->dev);
ide_unregister_region(tape->disk);

mutex_lock(&idetape_ref_mutex);
put_device(&tape->dev);
Expand Down Expand Up @@ -2026,7 +2025,6 @@ static int ide_tape_probe(ide_drive_t *drive)
"n%s", tape->name);

g->fops = &idetape_block_ops;
ide_register_region(g);

return 0;

Expand Down
3 changes: 0 additions & 3 deletions include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1493,9 +1493,6 @@ static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; }
static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
#endif

void ide_register_region(struct gendisk *);
void ide_unregister_region(struct gendisk *);

void ide_check_nien_quirk_list(ide_drive_t *);
void ide_undecoded_slave(ide_drive_t *);

Expand Down

0 comments on commit d18e8b1

Please sign in to comment.