Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parport: remove unused dead code from lowlevel drivers

This unused code has been untouched for over 7 years and must
go.

Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Matt Porter and committed by
Greg Kroah-Hartman
99121438 1790625f

-377
-36
drivers/parport/parport_amiga.c
··· 48 48 return ciaa.prb; 49 49 } 50 50 51 - #if 0 52 - static unsigned char control_pc_to_amiga(unsigned char control) 53 - { 54 - unsigned char ret = 0; 55 - 56 - if (control & PARPORT_CONTROL_SELECT) /* XXX: What is SELECP? */ 57 - ; 58 - if (control & PARPORT_CONTROL_INIT) /* INITP */ 59 - /* reset connected to cpu reset pin */; 60 - if (control & PARPORT_CONTROL_AUTOFD) /* AUTOLF */ 61 - /* Not connected */; 62 - if (control & PARPORT_CONTROL_STROBE) /* Strobe */ 63 - /* Handled only directly by hardware */; 64 - return ret; 65 - } 66 - #endif 67 - 68 51 static unsigned char control_amiga_to_pc(unsigned char control) 69 52 { 70 53 return PARPORT_CONTROL_SELECT | ··· 77 94 amiga_write_control(p, (old & ~mask) ^ val); 78 95 return old; 79 96 } 80 - 81 - #if 0 /* currently unused */ 82 - static unsigned char status_pc_to_amiga(unsigned char status) 83 - { 84 - unsigned char ret = 1; 85 - 86 - if (status & PARPORT_STATUS_BUSY) /* Busy */ 87 - ret &= ~1; 88 - if (status & PARPORT_STATUS_ACK) /* Ack */ 89 - /* handled in hardware */; 90 - if (status & PARPORT_STATUS_PAPEROUT) /* PaperOut */ 91 - ret |= 2; 92 - if (status & PARPORT_STATUS_SELECT) /* select */ 93 - ret |= 4; 94 - if (status & PARPORT_STATUS_ERROR) /* error */ 95 - /* not connected */; 96 - return ret; 97 - } 98 - #endif 99 97 100 98 static unsigned char status_amiga_to_pc(unsigned char status) 101 99 {
-9
drivers/parport/parport_atari.c
··· 130 130 static void 131 131 parport_atari_data_reverse(struct parport *p) 132 132 { 133 - #if 0 /* too dangerous, can kill sound chip */ 134 - unsigned long flags; 135 - 136 - local_irq_save(flags); 137 - /* Soundchip port B as input. */ 138 - sound_ym.rd_data_reg_sel = 7; 139 - sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~0x40; 140 - local_irq_restore(flags); 141 - #endif 142 133 } 143 134 144 135 static struct parport_operations parport_atari_ops = {
-35
drivers/parport/parport_mfc3.c
··· 147 147 return old; 148 148 } 149 149 150 - #if 0 /* currently unused */ 151 - static unsigned char status_pc_to_mfc3(unsigned char status) 152 - { 153 - unsigned char ret = 1; 154 - 155 - if (status & PARPORT_STATUS_BUSY) /* Busy */ 156 - ret &= ~1; 157 - if (status & PARPORT_STATUS_ACK) /* Ack */ 158 - ret |= 8; 159 - if (status & PARPORT_STATUS_PAPEROUT) /* PaperOut */ 160 - ret |= 2; 161 - if (status & PARPORT_STATUS_SELECT) /* select */ 162 - ret |= 4; 163 - if (status & PARPORT_STATUS_ERROR) /* error */ 164 - ret |= 16; 165 - return ret; 166 - } 167 - #endif 168 - 169 150 static unsigned char status_mfc3_to_pc(unsigned char status) 170 151 { 171 152 unsigned char ret = PARPORT_STATUS_BUSY; ··· 165 184 return ret; 166 185 } 167 186 168 - #if 0 /* currently unused */ 169 - static void mfc3_write_status( struct parport *p, unsigned char status) 170 - { 171 - DPRINTK(KERN_DEBUG "write_status %02x\n",status); 172 - pia(p)->ppra = (pia(p)->ppra & 0xe0) | status_pc_to_mfc3(status); 173 - } 174 - #endif 175 - 176 187 static unsigned char mfc3_read_status(struct parport *p) 177 188 { 178 189 unsigned char status; ··· 173 200 DPRINTK(KERN_DEBUG "read_status %02x\n", status); 174 201 return status; 175 202 } 176 - 177 - #if 0 /* currently unused */ 178 - static void mfc3_change_mode( struct parport *p, int m) 179 - { 180 - /* XXX: This port only has one mode, and I am 181 - not sure about the corresponding PC-style mode*/ 182 - } 183 - #endif 184 203 185 204 static int use_cnt = 0; 186 205
-276
drivers/parport/parport_pc.c
··· 197 197 ECR_WRITE(p, oecr); 198 198 return 0; 199 199 } 200 - 201 - #ifdef CONFIG_PARPORT_1284 202 - /* Find FIFO lossage; FIFO is reset */ 203 - #if 0 204 - static int get_fifo_residue(struct parport *p) 205 - { 206 - int residue; 207 - int cnfga; 208 - const struct parport_pc_private *priv = p->physport->private_data; 209 - 210 - /* Adjust for the contents of the FIFO. */ 211 - for (residue = priv->fifo_depth; ; residue--) { 212 - if (inb(ECONTROL(p)) & 0x2) 213 - /* Full up. */ 214 - break; 215 - 216 - outb(0, FIFO(p)); 217 - } 218 - 219 - printk(KERN_DEBUG "%s: %d PWords were left in FIFO\n", p->name, 220 - residue); 221 - 222 - /* Reset the FIFO. */ 223 - frob_set_mode(p, ECR_PS2); 224 - 225 - /* Now change to config mode and clean up. FIXME */ 226 - frob_set_mode(p, ECR_CNF); 227 - cnfga = inb(CONFIGA(p)); 228 - printk(KERN_DEBUG "%s: cnfgA contains 0x%02x\n", p->name, cnfga); 229 - 230 - if (!(cnfga & (1<<2))) { 231 - printk(KERN_DEBUG "%s: Accounting for extra byte\n", p->name); 232 - residue++; 233 - } 234 - 235 - /* Don't care about partial PWords until support is added for 236 - * PWord != 1 byte. */ 237 - 238 - /* Back to PS2 mode. */ 239 - frob_set_mode(p, ECR_PS2); 240 - 241 - DPRINTK(KERN_DEBUG 242 - "*** get_fifo_residue: done residue collecting (ecr = 0x%2.2x)\n", 243 - inb(ECONTROL(p))); 244 - return residue; 245 - } 246 - #endif /* 0 */ 247 - #endif /* IEEE 1284 support */ 248 200 #endif /* FIFO support */ 249 201 250 202 /* ··· 892 940 893 941 return written; 894 942 } 895 - 896 - #if 0 897 - static size_t parport_pc_ecp_read_block_pio(struct parport *port, 898 - void *buf, size_t length, 899 - int flags) 900 - { 901 - size_t left = length; 902 - size_t fifofull; 903 - int r; 904 - const int fifo = FIFO(port); 905 - const struct parport_pc_private *priv = port->physport->private_data; 906 - const int fifo_depth = priv->fifo_depth; 907 - char *bufp = buf; 908 - 909 - port = port->physport; 910 - DPRINTK(KERN_DEBUG "parport_pc: parport_pc_ecp_read_block_pio\n"); 911 - dump_parport_state("enter fcn", port); 912 - 913 - /* Special case: a timeout of zero means we cannot call schedule(). 914 - * Also if O_NONBLOCK is set then use the default implementation. */ 915 - if (port->cad->timeout <= PARPORT_INACTIVITY_O_NONBLOCK) 916 - return parport_ieee1284_ecp_read_data(port, buf, 917 - length, flags); 918 - 919 - if (port->ieee1284.mode == IEEE1284_MODE_ECPRLE) { 920 - /* If the peripheral is allowed to send RLE compressed 921 - * data, it is possible for a byte to expand to 128 922 - * bytes in the FIFO. */ 923 - fifofull = 128; 924 - } else { 925 - fifofull = fifo_depth; 926 - } 927 - 928 - /* If the caller wants less than a full FIFO's worth of data, 929 - * go through software emulation. Otherwise we may have to throw 930 - * away data. */ 931 - if (length < fifofull) 932 - return parport_ieee1284_ecp_read_data(port, buf, 933 - length, flags); 934 - 935 - if (port->ieee1284.phase != IEEE1284_PH_REV_IDLE) { 936 - /* change to reverse-idle phase (must be in forward-idle) */ 937 - 938 - /* Event 38: Set nAutoFd low (also make sure nStrobe is high) */ 939 - parport_frob_control(port, 940 - PARPORT_CONTROL_AUTOFD 941 - | PARPORT_CONTROL_STROBE, 942 - PARPORT_CONTROL_AUTOFD); 943 - parport_pc_data_reverse(port); /* Must be in PS2 mode */ 944 - udelay(5); 945 - /* Event 39: Set nInit low to initiate bus reversal */ 946 - parport_frob_control(port, 947 - PARPORT_CONTROL_INIT, 948 - 0); 949 - /* Event 40: Wait for nAckReverse (PError) to go low */ 950 - r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, 0); 951 - if (r) { 952 - printk(KERN_DEBUG "%s: PE timeout Event 40 (%d) " 953 - "in ecp_read_block_pio\n", port->name, r); 954 - return 0; 955 - } 956 - } 957 - 958 - /* Set up ECP FIFO mode.*/ 959 - /* parport_pc_frob_control(port, 960 - PARPORT_CONTROL_STROBE | 961 - PARPORT_CONTROL_AUTOFD, 962 - PARPORT_CONTROL_AUTOFD); */ 963 - r = change_mode(port, ECR_ECP); /* ECP FIFO */ 964 - if (r) 965 - printk(KERN_DEBUG "%s: Warning change_mode ECR_ECP failed\n", 966 - port->name); 967 - 968 - port->ieee1284.phase = IEEE1284_PH_REV_DATA; 969 - 970 - /* the first byte must be collected manually */ 971 - dump_parport_state("pre 43", port); 972 - /* Event 43: Wait for nAck to go low */ 973 - r = parport_wait_peripheral(port, PARPORT_STATUS_ACK, 0); 974 - if (r) { 975 - /* timed out while reading -- no data */ 976 - printk(KERN_DEBUG "PIO read timed out (initial byte)\n"); 977 - goto out_no_data; 978 - } 979 - /* read byte */ 980 - *bufp++ = inb(DATA(port)); 981 - left--; 982 - dump_parport_state("43-44", port); 983 - /* Event 44: nAutoFd (HostAck) goes high to acknowledge */ 984 - parport_pc_frob_control(port, 985 - PARPORT_CONTROL_AUTOFD, 986 - 0); 987 - dump_parport_state("pre 45", port); 988 - /* Event 45: Wait for nAck to go high */ 989 - /* r = parport_wait_peripheral(port, PARPORT_STATUS_ACK, 990 - PARPORT_STATUS_ACK); */ 991 - dump_parport_state("post 45", port); 992 - r = 0; 993 - if (r) { 994 - /* timed out while waiting for peripheral to respond to ack */ 995 - printk(KERN_DEBUG "ECP PIO read timed out (waiting for nAck)\n"); 996 - 997 - /* keep hold of the byte we've got already */ 998 - goto out_no_data; 999 - } 1000 - /* Event 46: nAutoFd (HostAck) goes low to accept more data */ 1001 - parport_pc_frob_control(port, 1002 - PARPORT_CONTROL_AUTOFD, 1003 - PARPORT_CONTROL_AUTOFD); 1004 - 1005 - 1006 - dump_parport_state("rev idle", port); 1007 - /* Do the transfer. */ 1008 - while (left > fifofull) { 1009 - int ret; 1010 - unsigned long expire = jiffies + port->cad->timeout; 1011 - unsigned char ecrval = inb(ECONTROL(port)); 1012 - 1013 - if (need_resched() && time_before(jiffies, expire)) 1014 - /* Can't yield the port. */ 1015 - schedule(); 1016 - 1017 - /* At this point, the FIFO may already be full. In 1018 - * that case ECP is already holding back the 1019 - * peripheral (assuming proper design) with a delayed 1020 - * handshake. Work fast to avoid a peripheral 1021 - * timeout. */ 1022 - 1023 - if (ecrval & 0x01) { 1024 - /* FIFO is empty. Wait for interrupt. */ 1025 - dump_parport_state("FIFO empty", port); 1026 - 1027 - /* Anyone else waiting for the port? */ 1028 - if (port->waithead) { 1029 - printk(KERN_DEBUG "Somebody wants the port\n"); 1030 - break; 1031 - } 1032 - 1033 - /* Clear serviceIntr */ 1034 - ECR_WRITE(port, ecrval & ~(1<<2)); 1035 - false_alarm: 1036 - dump_parport_state("waiting", port); 1037 - ret = parport_wait_event(port, HZ); 1038 - DPRINTK(KERN_DEBUG "parport_wait_event returned %d\n", 1039 - ret); 1040 - if (ret < 0) 1041 - break; 1042 - ret = 0; 1043 - if (!time_before(jiffies, expire)) { 1044 - /* Timed out. */ 1045 - dump_parport_state("timeout", port); 1046 - printk(KERN_DEBUG "PIO read timed out\n"); 1047 - break; 1048 - } 1049 - ecrval = inb(ECONTROL(port)); 1050 - if (!(ecrval & (1<<2))) { 1051 - if (need_resched() && 1052 - time_before(jiffies, expire)) { 1053 - schedule(); 1054 - } 1055 - goto false_alarm; 1056 - } 1057 - 1058 - /* Depending on how the FIFO threshold was 1059 - * set, how long interrupt service took, and 1060 - * how fast the peripheral is, we might be 1061 - * lucky and have a just filled FIFO. */ 1062 - continue; 1063 - } 1064 - 1065 - if (ecrval & 0x02) { 1066 - /* FIFO is full. */ 1067 - dump_parport_state("FIFO full", port); 1068 - insb(fifo, bufp, fifo_depth); 1069 - bufp += fifo_depth; 1070 - left -= fifo_depth; 1071 - continue; 1072 - } 1073 - 1074 - DPRINTK(KERN_DEBUG 1075 - "*** ecp_read_block_pio: reading one byte from the FIFO\n"); 1076 - 1077 - /* FIFO not filled. We will cycle this loop for a while 1078 - * and either the peripheral will fill it faster, 1079 - * tripping a fast empty with insb, or we empty it. */ 1080 - *bufp++ = inb(fifo); 1081 - left--; 1082 - } 1083 - 1084 - /* scoop up anything left in the FIFO */ 1085 - while (left && !(inb(ECONTROL(port) & 0x01))) { 1086 - *bufp++ = inb(fifo); 1087 - left--; 1088 - } 1089 - 1090 - port->ieee1284.phase = IEEE1284_PH_REV_IDLE; 1091 - dump_parport_state("rev idle2", port); 1092 - 1093 - out_no_data: 1094 - 1095 - /* Go to forward idle mode to shut the peripheral up (event 47). */ 1096 - parport_frob_control(port, PARPORT_CONTROL_INIT, PARPORT_CONTROL_INIT); 1097 - 1098 - /* event 49: PError goes high */ 1099 - r = parport_wait_peripheral(port, 1100 - PARPORT_STATUS_PAPEROUT, 1101 - PARPORT_STATUS_PAPEROUT); 1102 - if (r) { 1103 - printk(KERN_DEBUG 1104 - "%s: PE timeout FWDIDLE (%d) in ecp_read_block_pio\n", 1105 - port->name, r); 1106 - } 1107 - 1108 - port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; 1109 - 1110 - /* Finish up. */ 1111 - { 1112 - int lost = get_fifo_residue(port); 1113 - if (lost) 1114 - /* Shouldn't happen with compliant peripherals. */ 1115 - printk(KERN_DEBUG "%s: DATA LOSS (%d bytes)!\n", 1116 - port->name, lost); 1117 - } 1118 - 1119 - dump_parport_state("fwd idle", port); 1120 - return length - left; 1121 - } 1122 - #endif /* 0 */ 1123 943 #endif /* IEEE 1284 support */ 1124 944 #endif /* Allowed to use FIFO/DMA */ 1125 945
-21
drivers/parport/parport_sunbpp.c
··· 82 82 return sbus_readb(&regs->p_dr); 83 83 } 84 84 85 - #if 0 86 - static void control_pc_to_sunbpp(struct parport *p, unsigned char status) 87 - { 88 - struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; 89 - unsigned char value_tcr = sbus_readb(&regs->p_tcr); 90 - unsigned char value_or = sbus_readb(&regs->p_or); 91 - 92 - if (status & PARPORT_CONTROL_STROBE) 93 - value_tcr |= P_TCR_DS; 94 - if (status & PARPORT_CONTROL_AUTOFD) 95 - value_or |= P_OR_AFXN; 96 - if (status & PARPORT_CONTROL_INIT) 97 - value_or |= P_OR_INIT; 98 - if (status & PARPORT_CONTROL_SELECT) 99 - value_or |= P_OR_SLCT_IN; 100 - 101 - sbus_writeb(value_or, &regs->p_or); 102 - sbus_writeb(value_tcr, &regs->p_tcr); 103 - } 104 - #endif 105 - 106 85 static unsigned char status_sunbpp_to_pc(struct parport *p) 107 86 { 108 87 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base;