patch-2.3.40 linux/drivers/block/acsi.c
Next file: linux/drivers/block/aec6210.c
Previous file: linux/drivers/block/Makefile
Back to the patch index
Back to the overall index
- Lines: 131
- Date:
Tue Jan 18 18:54:21 2000
- Orig file:
v2.3.39/linux/drivers/block/acsi.c
- Orig date:
Tue Jan 11 22:31:39 2000
diff -u --recursive --new-file v2.3.39/linux/drivers/block/acsi.c linux/drivers/block/acsi.c
@@ -369,7 +369,7 @@
static void acsi_prevent_removal( int target, int flag );
static int acsi_change_blk_size( int target, int lun);
static int acsi_mode_sense( int target, int lun, SENSE_DATA *sd );
-static void acsi_geninit( struct gendisk *gd );
+static void acsi_geninit(void);
static int revalidate_acsidisk( int dev, int maxusage );
static int acsi_revalidate (dev_t);
@@ -1386,21 +1386,15 @@
static struct gendisk acsi_gendisk = {
- MAJOR_NR, /* Major number */
- "ad", /* Major name */
- 4, /* Bits to shift to get real from partition */
- 1 << 4, /* Number of partitions per real */
- MAX_DEV, /* maximum number of real */
-#ifdef MODULE
- NULL, /* called from init_module() */
-#else
- acsi_geninit, /* init function */
-#endif
- acsi_part, /* hd struct */
- acsi_sizes, /* block sizes */
- 0, /* number */
+ MAJOR_NR, /* Major number */
+ "ad", /* Major name */
+ 4, /* Bits to shift to get real from partition */
+ 1 << 4, /* Number of partitions per real */
+ acsi_part, /* hd struct */
+ acsi_sizes, /* block sizes */
+ 0, /* number */
(void *)acsi_info, /* internal */
- NULL /* next */
+ NULL /* next */
};
#define MAX_SCSI_DEVICE_CODE 10
@@ -1659,7 +1653,15 @@
int SLM_devices[8];
#endif
-static void acsi_geninit( struct gendisk *gd )
+static struct block_device_operations acsi_fops = {
+ open: acsi_open,
+ release: acsi_release,
+ ioctl: acsi_ioctl,
+ check_media_change: acsi_media_change,
+ revalidate: acsi_revalidate,
+};
+
+static void acsi_geninit(void)
{
int i, target, lun;
struct acsi_info_struct *aip;
@@ -1741,14 +1743,15 @@
NDevices, n_slm );
#endif
- for( i = 0; i < NDevices; ++i ) {
- acsi_part[i<<4].start_sect = 0;
- acsi_part[i<<4].nr_sects = acsi_info[i].size;
- }
- acsi_gendisk.nr_real = NDevices;
for( i = 0; i < (MAX_DEV << 4); i++ )
acsi_blocksizes[i] = 1024;
blksize_size[MAJOR_NR] = acsi_blocksizes;
+ for( i = 0; i < NDevices; ++i )
+ register_disk(&acsi_gendisk, MKDEV(MAJOR_NR,i<<4),
+ (acsi_info[i].type==HARDDISK)?1<<4:1,
+ &acsi_fops,
+ acsi_info[i].size);
+ acsi_gendisk.nr_real = NDevices;
}
#ifdef CONFIG_ATARI_SLM_MODULE
@@ -1766,18 +1769,11 @@
}
#endif /* CONFIG_ATARI_SLM_MODULE */
-static struct block_device_operations acsi_fops = {
- open: acsi_open,
- release: acsi_release,
- ioctl: acsi_ioctl,
- check_media_change: acsi_media_change,
- revalidate: acsi_revalidate,
-};
-
int acsi_init( void )
{
+ int err = 0;
if (!MACH_IS_ATARI || !ATARIHW_PRESENT(ACSI))
return 0;
@@ -1801,10 +1797,11 @@
gendisk_head = &acsi_gendisk;
#ifdef CONFIG_ATARI_SLM
- return( slm_init() );
-#else
- return 0;
+ err = slm_init();
#endif
+ if (!err)
+ acsi_geninit();
+ return err;
}
@@ -1816,7 +1813,6 @@
if ((err = acsi_init()))
return( err );
printk( KERN_INFO "ACSI driver loaded as module.\n");
- acsi_geninit( &(struct gendisk){ 0,0,0,0,0,0,0,0,0,0,0 } );
return( 0 );
}
@@ -1914,9 +1910,7 @@
ENABLE_IRQ();
stdma_release();
- gdev->part[start].nr_sects = aip->size;
- if (aip->type == HARDDISK && aip->size > 0)
- resetup_one_dev(gdev, device);
+ grok_partitions(gdev, device, (aip->type==HARDDISK)?1<<4:1, aip->size);
DEVICE_BUSY = 0;
wake_up(&busy_wait);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)