diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:19 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:19 -0500 |
commit | b8d25dee3b73b572ea1778671098ee7b943133c5 (patch) | |
tree | 556b9bc286c9e13ca1b37b31becca9533fc0ea1d /drivers/ide/ide-cd.c | |
parent | f17b0e02c0035b90c4e943f6e2cca840f82dce0f (diff) |
ide-cd: remove needless zeroing of 'info' fields from ide_cdrom_setup()
ide_cd_probe() zeroes 'info' prior to calling ide_cdrom_setup() so there
is no need to explicitly zero 'info' fields in the latter function.
Ditto for fields of CDROM_STATE_FLAGS(), CDROM_CONFIG_FLAGS() and 'cdi'
(all are embedded in 'info').
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index bec6ac077b4d..cd3ea32041bb 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -2865,30 +2865,16 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2865 | drive->special.all = 0; | 2865 | drive->special.all = 0; |
2866 | 2866 | ||
2867 | CDROM_STATE_FLAGS(drive)->media_changed = 1; | 2867 | CDROM_STATE_FLAGS(drive)->media_changed = 1; |
2868 | CDROM_STATE_FLAGS(drive)->toc_valid = 0; | ||
2869 | CDROM_STATE_FLAGS(drive)->door_locked = 0; | ||
2870 | 2868 | ||
2871 | #if NO_DOOR_LOCKING | 2869 | #if NO_DOOR_LOCKING |
2872 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; | 2870 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; |
2873 | #else | ||
2874 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 0; | ||
2875 | #endif | 2871 | #endif |
2876 | 2872 | if ((drive->id->config & 0x0060) == 0x20) | |
2877 | CDROM_CONFIG_FLAGS(drive)->drq_interrupt = ((drive->id->config & 0x0060) == 0x20); | 2873 | CDROM_CONFIG_FLAGS(drive)->drq_interrupt = 1; |
2878 | CDROM_CONFIG_FLAGS(drive)->is_changer = 0; | ||
2879 | CDROM_CONFIG_FLAGS(drive)->cd_r = 0; | ||
2880 | CDROM_CONFIG_FLAGS(drive)->cd_rw = 0; | ||
2881 | CDROM_CONFIG_FLAGS(drive)->test_write = 0; | ||
2882 | CDROM_CONFIG_FLAGS(drive)->dvd = 0; | ||
2883 | CDROM_CONFIG_FLAGS(drive)->dvd_r = 0; | ||
2884 | CDROM_CONFIG_FLAGS(drive)->dvd_ram = 0; | ||
2885 | CDROM_CONFIG_FLAGS(drive)->no_eject = 1; | 2874 | CDROM_CONFIG_FLAGS(drive)->no_eject = 1; |
2886 | CDROM_CONFIG_FLAGS(drive)->supp_disc_present = 0; | ||
2887 | CDROM_CONFIG_FLAGS(drive)->audio_play = 0; | ||
2888 | CDROM_CONFIG_FLAGS(drive)->close_tray = 1; | 2875 | CDROM_CONFIG_FLAGS(drive)->close_tray = 1; |
2889 | 2876 | ||
2890 | /* limit transfer size per interrupt. */ | 2877 | /* limit transfer size per interrupt. */ |
2891 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 0; | ||
2892 | /* a testament to the nice quality of Samsung drives... */ | 2878 | /* a testament to the nice quality of Samsung drives... */ |
2893 | if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430")) | 2879 | if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430")) |
2894 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; | 2880 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; |
@@ -2899,16 +2885,6 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2899 | CDROM_CONFIG_FLAGS(drive)->no_speed_select = 1; | 2885 | CDROM_CONFIG_FLAGS(drive)->no_speed_select = 1; |
2900 | 2886 | ||
2901 | #if ! STANDARD_ATAPI | 2887 | #if ! STANDARD_ATAPI |
2902 | /* by default Sanyo 3 CD changer support is turned off and | ||
2903 | ATAPI Rev 2.2+ standard support for CD changers is used */ | ||
2904 | cdi->sanyo_slot = 0; | ||
2905 | |||
2906 | CDROM_CONFIG_FLAGS(drive)->nec260 = 0; | ||
2907 | CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 0; | ||
2908 | CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 0; | ||
2909 | CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 0; | ||
2910 | CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 0; | ||
2911 | |||
2912 | if (strcmp (drive->id->model, "V003S0DS") == 0 && | 2888 | if (strcmp (drive->id->model, "V003S0DS") == 0 && |
2913 | drive->id->fw_rev[4] == '1' && | 2889 | drive->id->fw_rev[4] == '1' && |
2914 | drive->id->fw_rev[6] <= '2') { | 2890 | drive->id->fw_rev[6] <= '2') { |
@@ -2942,8 +2918,10 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2942 | CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 1; | 2918 | CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 1; |
2943 | CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 1; | 2919 | CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 1; |
2944 | } | 2920 | } |
2945 | /* Sanyo 3 CD changer uses a non-standard command | 2921 | /* |
2946 | for CD changing */ | 2922 | * Sanyo 3 CD changer uses a non-standard command for CD changing |
2923 | * (by default standard ATAPI support for CD changers is used). | ||
2924 | */ | ||
2947 | else if ((strcmp(drive->id->model, "CD-ROM CDR-C3 G") == 0) || | 2925 | else if ((strcmp(drive->id->model, "CD-ROM CDR-C3 G") == 0) || |
2948 | (strcmp(drive->id->model, "CD-ROM CDR-C3G") == 0) || | 2926 | (strcmp(drive->id->model, "CD-ROM CDR-C3G") == 0) || |
2949 | (strcmp(drive->id->model, "CD-ROM CDR_C36") == 0)) { | 2927 | (strcmp(drive->id->model, "CD-ROM CDR_C36") == 0)) { |
@@ -2952,14 +2930,6 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2952 | } | 2930 | } |
2953 | #endif /* not STANDARD_ATAPI */ | 2931 | #endif /* not STANDARD_ATAPI */ |
2954 | 2932 | ||
2955 | info->toc = NULL; | ||
2956 | info->buffer = NULL; | ||
2957 | info->sector_buffered = 0; | ||
2958 | info->nsectors_buffered = 0; | ||
2959 | info->changer_info = NULL; | ||
2960 | info->last_block = 0; | ||
2961 | info->start_seek = 0; | ||
2962 | |||
2963 | nslots = ide_cdrom_probe_capabilities (drive); | 2933 | nslots = ide_cdrom_probe_capabilities (drive); |
2964 | 2934 | ||
2965 | /* | 2935 | /* |