Commit 81780a58 authored by Alexander Viro's avatar Alexander Viro Committed by Jens Axboe

[PATCH] cleaned up callers of devfs_mk_dir()

parent f350db2c
...@@ -5871,8 +5871,8 @@ int __init sbpcd_init(void) ...@@ -5871,8 +5871,8 @@ int __init sbpcd_init(void)
disk->fops = &sbpcd_bdops; disk->fops = &sbpcd_bdops;
strcpy(disk->disk_name, sbpcd_infop->name); strcpy(disk->disk_name, sbpcd_infop->name);
disk->flags = GENHD_FL_CD; disk->flags = GENHD_FL_CD;
sprintf(nbuff, "c0t%d", p->drv_id); sprintf(nbuff, "sbp/c0t%d", p->drv_id);
disk->de = devfs_mk_dir(devfs_handle, nbuff, NULL); disk->de = devfs_mk_dir(NULL, nbuff, NULL);
p->disk = disk; p->disk = disk;
if (register_cdrom(sbpcd_infop)) if (register_cdrom(sbpcd_infop))
{ {
......
...@@ -1047,7 +1047,6 @@ static int alloc_disks(ide_hwif_t *hwif) ...@@ -1047,7 +1047,6 @@ static int alloc_disks(ide_hwif_t *hwif)
static void init_gendisk (ide_hwif_t *hwif) static void init_gendisk (ide_hwif_t *hwif)
{ {
unsigned int unit; unsigned int unit;
extern devfs_handle_t ide_devfs_handle;
for (unit = 0; unit < MAX_DRIVES; ++unit) { for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t * drive = &hwif->drives[unit]; ide_drive_t * drive = &hwif->drives[unit];
...@@ -1059,13 +1058,13 @@ static void init_gendisk (ide_hwif_t *hwif) ...@@ -1059,13 +1058,13 @@ static void init_gendisk (ide_hwif_t *hwif)
"%s","IDE Drive"); "%s","IDE Drive");
drive->gendev.parent = &hwif->gendev; drive->gendev.parent = &hwif->gendev;
drive->gendev.bus = &ide_bus_type; drive->gendev.bus = &ide_bus_type;
sprintf (name, "host%d/bus%d/target%d/lun%d", sprintf (name, "ide/host%d/bus%d/target%d/lun%d",
(hwif->channel && hwif->mate) ? (hwif->channel && hwif->mate) ?
hwif->mate->index : hwif->index, hwif->mate->index : hwif->index,
hwif->channel, unit, drive->lun); hwif->channel, unit, drive->lun);
if (drive->present) { if (drive->present) {
device_register(&drive->gendev); device_register(&drive->gendev);
drive->de = devfs_mk_dir(ide_devfs_handle, name, NULL); drive->de = devfs_mk_dir(NULL, name, NULL);
} }
} }
blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS, blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
......
...@@ -350,7 +350,7 @@ int dvbdev_get_free_adapter_num (void) ...@@ -350,7 +350,7 @@ int dvbdev_get_free_adapter_num (void)
int dvb_register_adapter(dvb_adapter_t **padap, char *name) int dvb_register_adapter(dvb_adapter_t **padap, char *name)
{ {
char dirname[10]; char dirname[16];
dvb_adapter_t *adap; dvb_adapter_t *adap;
int num; int num;
...@@ -374,8 +374,8 @@ int dvb_register_adapter(dvb_adapter_t **padap, char *name) ...@@ -374,8 +374,8 @@ int dvb_register_adapter(dvb_adapter_t **padap, char *name)
printk ("%s: registering new adapter (%s).\n", __FUNCTION__, name); printk ("%s: registering new adapter (%s).\n", __FUNCTION__, name);
sprintf(dirname, "adapter%d", num); sprintf(dirname, "dvb/adapter%d", num);
adap->devfs_handle = devfs_mk_dir(dvb_devfs_handle, dirname, NULL); adap->devfs_handle = devfs_mk_dir(NULL, dirname, NULL);
adap->num = num; adap->num = num;
list_add_tail (&adap->list_head, &dvb_adapter_list); list_add_tail (&adap->list_head, &dvb_adapter_list);
......
...@@ -283,7 +283,7 @@ dasd_free_device(dasd_device_t *device) ...@@ -283,7 +283,7 @@ dasd_free_device(dasd_device_t *device)
static inline int static inline int
dasd_state_new_to_known(dasd_device_t *device) dasd_state_new_to_known(dasd_device_t *device)
{ {
char buffer[5]; char buffer[10];
dasd_devmap_t *devmap; dasd_devmap_t *devmap;
umode_t devfs_perm; umode_t devfs_perm;
devfs_handle_t dir; devfs_handle_t dir;
...@@ -303,8 +303,8 @@ dasd_state_new_to_known(dasd_device_t *device) ...@@ -303,8 +303,8 @@ dasd_state_new_to_known(dasd_device_t *device)
return rc; return rc;
/* Add a proc directory and the dasd device entry to devfs. */ /* Add a proc directory and the dasd device entry to devfs. */
sprintf(buffer, "%04x", device->devinfo.devno); sprintf(buffer, "dasd/%04x", device->devinfo.devno);
dir = devfs_mk_dir(dasd_devfs_handle, buffer, device); dir = devfs_mk_dir(NULL, buffer, NULL);
device->gdp->de = dir; device->gdp->de = dir;
if (devmap->features & DASD_FEATURE_READONLY) if (devmap->features & DASD_FEATURE_READONLY)
devfs_perm = S_IFBLK | S_IRUSR; devfs_perm = S_IFBLK | S_IRUSR;
......
...@@ -1323,7 +1323,6 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew, ...@@ -1323,7 +1323,6 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew,
{ {
Scsi_Device *sdev; Scsi_Device *sdev;
char devname[64]; char devname[64];
extern devfs_handle_t scsi_devfs_handle;
sdev = scsi_alloc_sdev(sdevscan->host, sdevscan->channel, sdev = scsi_alloc_sdev(sdevscan->host, sdevscan->channel,
sdevscan->id, sdevscan->lun); sdevscan->id, sdevscan->lun);
...@@ -1445,13 +1444,13 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew, ...@@ -1445,13 +1444,13 @@ static int scsi_add_lun(Scsi_Device *sdevscan, Scsi_Device **sdevnew,
*/ */
device_create_file(&sdev->sdev_driverfs_dev, &dev_attr_type); device_create_file(&sdev->sdev_driverfs_dev, &dev_attr_type);
sprintf(devname, "host%d/bus%d/target%d/lun%d", sprintf(devname, "scsi/host%d/bus%d/target%d/lun%d",
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
if (sdev->de) if (sdev->de)
printk(KERN_WARNING "scsi devfs dir: \"%s\" already exists\n", printk(KERN_WARNING "scsi devfs dir: \"%s\" already exists\n",
devname); devname);
else else
sdev->de = devfs_mk_dir(scsi_devfs_handle, devname, NULL); sdev->de = devfs_mk_dir(NULL, devname, NULL);
/* /*
* End driverfs/devfs code. * End driverfs/devfs code.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment