Skip to content

Commit

Permalink
device create: ide: convert device_create to device_create_drvdata
Browse files Browse the repository at this point in the history
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.

Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jul 22, 2008
1 parent 1cc4376 commit 6ecaaf9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -2697,10 +2697,12 @@ static int ide_tape_probe(ide_drive_t *drive)

idetape_setup(drive, tape, minor);

device_create(idetape_sysfs_class, &drive->gendev,
MKDEV(IDETAPE_MAJOR, minor), "%s", tape->name);
device_create(idetape_sysfs_class, &drive->gendev,
MKDEV(IDETAPE_MAJOR, minor + 128), "n%s", tape->name);
device_create_drvdata(idetape_sysfs_class, &drive->gendev,
MKDEV(IDETAPE_MAJOR, minor), NULL,
"%s", tape->name);
device_create_drvdata(idetape_sysfs_class, &drive->gendev,
MKDEV(IDETAPE_MAJOR, minor + 128), NULL,
"n%s", tape->name);

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

0 comments on commit 6ecaaf9

Please sign in to comment.