diff options
Diffstat (limited to 'drivers')
70 files changed, 370 insertions, 1247 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 52dc2d8b8f22..8e37be19bbf5 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -738,7 +738,6 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev) | |||
738 | * do_pata_set_dmamode - Initialize host controller PATA PIO timings | 738 | * do_pata_set_dmamode - Initialize host controller PATA PIO timings |
739 | * @ap: Port whose timings we are configuring | 739 | * @ap: Port whose timings we are configuring |
740 | * @adev: Drive in question | 740 | * @adev: Drive in question |
741 | * @udma: udma mode, 0 - 6 | ||
742 | * @isich: set if the chip is an ICH device | 741 | * @isich: set if the chip is an ICH device |
743 | * | 742 | * |
744 | * Set UDMA mode for device, in host controller PCI config space. | 743 | * Set UDMA mode for device, in host controller PCI config space. |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 2ff633c119e2..82af7011f2dd 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1268,7 +1268,7 @@ u64 ata_tf_to_lba48(const struct ata_taskfile *tf) | |||
1268 | 1268 | ||
1269 | sectors |= ((u64)(tf->hob_lbah & 0xff)) << 40; | 1269 | sectors |= ((u64)(tf->hob_lbah & 0xff)) << 40; |
1270 | sectors |= ((u64)(tf->hob_lbam & 0xff)) << 32; | 1270 | sectors |= ((u64)(tf->hob_lbam & 0xff)) << 32; |
1271 | sectors |= (tf->hob_lbal & 0xff) << 24; | 1271 | sectors |= ((u64)(tf->hob_lbal & 0xff)) << 24; |
1272 | sectors |= (tf->lbah & 0xff) << 16; | 1272 | sectors |= (tf->lbah & 0xff) << 16; |
1273 | sectors |= (tf->lbam & 0xff) << 8; | 1273 | sectors |= (tf->lbam & 0xff) << 8; |
1274 | sectors |= (tf->lbal & 0xff); | 1274 | sectors |= (tf->lbal & 0xff); |
@@ -1602,7 +1602,6 @@ unsigned long ata_id_xfermask(const u16 *id) | |||
1602 | /** | 1602 | /** |
1603 | * ata_pio_queue_task - Queue port_task | 1603 | * ata_pio_queue_task - Queue port_task |
1604 | * @ap: The ata_port to queue port_task for | 1604 | * @ap: The ata_port to queue port_task for |
1605 | * @fn: workqueue function to be scheduled | ||
1606 | * @data: data for @fn to use | 1605 | * @data: data for @fn to use |
1607 | * @delay: delay time in msecs for workqueue function | 1606 | * @delay: delay time in msecs for workqueue function |
1608 | * | 1607 | * |
@@ -2159,6 +2158,10 @@ retry: | |||
2159 | static inline u8 ata_dev_knobble(struct ata_device *dev) | 2158 | static inline u8 ata_dev_knobble(struct ata_device *dev) |
2160 | { | 2159 | { |
2161 | struct ata_port *ap = dev->link->ap; | 2160 | struct ata_port *ap = dev->link->ap; |
2161 | |||
2162 | if (ata_dev_blacklisted(dev) & ATA_HORKAGE_BRIDGE_OK) | ||
2163 | return 0; | ||
2164 | |||
2162 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id))); | 2165 | return ((ap->cbl == ATA_CBL_SATA) && (!ata_id_is_sata(dev->id))); |
2163 | } | 2166 | } |
2164 | 2167 | ||
@@ -4063,6 +4066,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4063 | { "TSSTcorp CDDVDW SH-S202N", "SB00", ATA_HORKAGE_IVB, }, | 4066 | { "TSSTcorp CDDVDW SH-S202N", "SB00", ATA_HORKAGE_IVB, }, |
4064 | { "TSSTcorp CDDVDW SH-S202N", "SB01", ATA_HORKAGE_IVB, }, | 4067 | { "TSSTcorp CDDVDW SH-S202N", "SB01", ATA_HORKAGE_IVB, }, |
4065 | 4068 | ||
4069 | /* Devices that do not need bridging limits applied */ | ||
4070 | { "MTRON MSP-SATA*", NULL, ATA_HORKAGE_BRIDGE_OK, }, | ||
4071 | |||
4066 | /* End Marker */ | 4072 | /* End Marker */ |
4067 | { } | 4073 | { } |
4068 | }; | 4074 | }; |
@@ -4648,7 +4654,6 @@ static void ata_verify_xfer(struct ata_queued_cmd *qc) | |||
4648 | /** | 4654 | /** |
4649 | * ata_qc_complete - Complete an active ATA command | 4655 | * ata_qc_complete - Complete an active ATA command |
4650 | * @qc: Command to complete | 4656 | * @qc: Command to complete |
4651 | * @err_mask: ATA Status register contents | ||
4652 | * | 4657 | * |
4653 | * Indicate to the mid and upper layers that an ATA | 4658 | * Indicate to the mid and upper layers that an ATA |
4654 | * command has completed, with either an ok or not-ok status. | 4659 | * command has completed, with either an ok or not-ok status. |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index 5b72e734300a..62367fe4d5dc 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -44,11 +44,16 @@ | |||
44 | #include <linux/libata.h> | 44 | #include <linux/libata.h> |
45 | 45 | ||
46 | #define DRV_NAME "sata_via" | 46 | #define DRV_NAME "sata_via" |
47 | #define DRV_VERSION "2.3" | 47 | #define DRV_VERSION "2.4" |
48 | 48 | ||
49 | /* | ||
50 | * vt8251 is different from other sata controllers of VIA. It has two | ||
51 | * channels, each channel has both Master and Slave slot. | ||
52 | */ | ||
49 | enum board_ids_enum { | 53 | enum board_ids_enum { |
50 | vt6420, | 54 | vt6420, |
51 | vt6421, | 55 | vt6421, |
56 | vt8251, | ||
52 | }; | 57 | }; |
53 | 58 | ||
54 | enum { | 59 | enum { |
@@ -70,6 +75,8 @@ enum { | |||
70 | static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); | 75 | static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); |
71 | static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); | 76 | static int svia_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); |
72 | static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); | 77 | static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); |
78 | static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val); | ||
79 | static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val); | ||
73 | static void svia_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); | 80 | static void svia_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); |
74 | static void svia_noop_freeze(struct ata_port *ap); | 81 | static void svia_noop_freeze(struct ata_port *ap); |
75 | static int vt6420_prereset(struct ata_link *link, unsigned long deadline); | 82 | static int vt6420_prereset(struct ata_link *link, unsigned long deadline); |
@@ -79,12 +86,12 @@ static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev); | |||
79 | 86 | ||
80 | static const struct pci_device_id svia_pci_tbl[] = { | 87 | static const struct pci_device_id svia_pci_tbl[] = { |
81 | { PCI_VDEVICE(VIA, 0x5337), vt6420 }, | 88 | { PCI_VDEVICE(VIA, 0x5337), vt6420 }, |
82 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, | 89 | { PCI_VDEVICE(VIA, 0x0591), vt6420 }, /* 2 sata chnls (Master) */ |
83 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, | 90 | { PCI_VDEVICE(VIA, 0x3149), vt6420 }, /* 2 sata chnls (Master) */ |
84 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, | 91 | { PCI_VDEVICE(VIA, 0x3249), vt6421 }, /* 2 sata chnls, 1 pata chnl */ |
85 | { PCI_VDEVICE(VIA, 0x5287), vt6420 }, | ||
86 | { PCI_VDEVICE(VIA, 0x5372), vt6420 }, | 92 | { PCI_VDEVICE(VIA, 0x5372), vt6420 }, |
87 | { PCI_VDEVICE(VIA, 0x7372), vt6420 }, | 93 | { PCI_VDEVICE(VIA, 0x7372), vt6420 }, |
94 | { PCI_VDEVICE(VIA, 0x5287), vt8251 }, /* 2 sata chnls (Master/Slave) */ | ||
88 | 95 | ||
89 | { } /* terminate list */ | 96 | { } /* terminate list */ |
90 | }; | 97 | }; |
@@ -128,6 +135,13 @@ static struct ata_port_operations vt6421_sata_ops = { | |||
128 | .scr_write = svia_scr_write, | 135 | .scr_write = svia_scr_write, |
129 | }; | 136 | }; |
130 | 137 | ||
138 | static struct ata_port_operations vt8251_ops = { | ||
139 | .inherits = &svia_base_ops, | ||
140 | .hardreset = sata_std_hardreset, | ||
141 | .scr_read = vt8251_scr_read, | ||
142 | .scr_write = vt8251_scr_write, | ||
143 | }; | ||
144 | |||
131 | static const struct ata_port_info vt6420_port_info = { | 145 | static const struct ata_port_info vt6420_port_info = { |
132 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, | 146 | .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, |
133 | .pio_mask = 0x1f, | 147 | .pio_mask = 0x1f, |
@@ -152,6 +166,15 @@ static struct ata_port_info vt6421_pport_info = { | |||
152 | .port_ops = &vt6421_pata_ops, | 166 | .port_ops = &vt6421_pata_ops, |
153 | }; | 167 | }; |
154 | 168 | ||
169 | static struct ata_port_info vt8251_port_info = { | ||
170 | .flags = ATA_FLAG_SATA | ATA_FLAG_SLAVE_POSS | | ||
171 | ATA_FLAG_NO_LEGACY, | ||
172 | .pio_mask = 0x1f, | ||
173 | .mwdma_mask = 0x07, | ||
174 | .udma_mask = ATA_UDMA6, | ||
175 | .port_ops = &vt8251_ops, | ||
176 | }; | ||
177 | |||
155 | MODULE_AUTHOR("Jeff Garzik"); | 178 | MODULE_AUTHOR("Jeff Garzik"); |
156 | MODULE_DESCRIPTION("SCSI low-level driver for VIA SATA controllers"); | 179 | MODULE_DESCRIPTION("SCSI low-level driver for VIA SATA controllers"); |
157 | MODULE_LICENSE("GPL"); | 180 | MODULE_LICENSE("GPL"); |
@@ -174,6 +197,83 @@ static int svia_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) | |||
174 | return 0; | 197 | return 0; |
175 | } | 198 | } |
176 | 199 | ||
200 | static int vt8251_scr_read(struct ata_link *link, unsigned int scr, u32 *val) | ||
201 | { | ||
202 | static const u8 ipm_tbl[] = { 1, 2, 6, 0 }; | ||
203 | struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); | ||
204 | int slot = 2 * link->ap->port_no + link->pmp; | ||
205 | u32 v = 0; | ||
206 | u8 raw; | ||
207 | |||
208 | switch (scr) { | ||
209 | case SCR_STATUS: | ||
210 | pci_read_config_byte(pdev, 0xA0 + slot, &raw); | ||
211 | |||
212 | /* read the DET field, bit0 and 1 of the config byte */ | ||
213 | v |= raw & 0x03; | ||
214 | |||
215 | /* read the SPD field, bit4 of the configure byte */ | ||
216 | if (raw & (1 << 4)) | ||
217 | v |= 0x02 << 4; | ||
218 | else | ||
219 | v |= 0x01 << 4; | ||
220 | |||
221 | /* read the IPM field, bit2 and 3 of the config byte */ | ||
222 | v |= ipm_tbl[(raw >> 2) & 0x3]; | ||
223 | break; | ||
224 | |||
225 | case SCR_ERROR: | ||
226 | /* devices other than 5287 uses 0xA8 as base */ | ||
227 | WARN_ON(pdev->device != 0x5287); | ||
228 | pci_read_config_dword(pdev, 0xB0 + slot * 4, &v); | ||
229 | break; | ||
230 | |||
231 | case SCR_CONTROL: | ||
232 | pci_read_config_byte(pdev, 0xA4 + slot, &raw); | ||
233 | |||
234 | /* read the DET field, bit0 and bit1 */ | ||
235 | v |= ((raw & 0x02) << 1) | (raw & 0x01); | ||
236 | |||
237 | /* read the IPM field, bit2 and bit3 */ | ||
238 | v |= ((raw >> 2) & 0x03) << 8; | ||
239 | break; | ||
240 | |||
241 | default: | ||
242 | return -EINVAL; | ||
243 | } | ||
244 | |||
245 | *val = v; | ||
246 | return 0; | ||
247 | } | ||
248 | |||
249 | static int vt8251_scr_write(struct ata_link *link, unsigned int scr, u32 val) | ||
250 | { | ||
251 | struct pci_dev *pdev = to_pci_dev(link->ap->host->dev); | ||
252 | int slot = 2 * link->ap->port_no + link->pmp; | ||
253 | u32 v = 0; | ||
254 | |||
255 | switch (scr) { | ||
256 | case SCR_ERROR: | ||
257 | /* devices other than 5287 uses 0xA8 as base */ | ||
258 | WARN_ON(pdev->device != 0x5287); | ||
259 | pci_write_config_dword(pdev, 0xB0 + slot * 4, val); | ||
260 | return 0; | ||
261 | |||
262 | case SCR_CONTROL: | ||
263 | /* set the DET field */ | ||
264 | v |= ((val & 0x4) >> 1) | (val & 0x1); | ||
265 | |||
266 | /* set the IPM field */ | ||
267 | v |= ((val >> 8) & 0x3) << 2; | ||
268 | |||
269 | pci_write_config_byte(pdev, 0xA4 + slot, v); | ||
270 | return 0; | ||
271 | |||
272 | default: | ||
273 | return -EINVAL; | ||
274 | } | ||
275 | } | ||
276 | |||
177 | /** | 277 | /** |
178 | * svia_tf_load - send taskfile registers to host controller | 278 | * svia_tf_load - send taskfile registers to host controller |
179 | * @ap: Port to which output is sent | 279 | * @ap: Port to which output is sent |
@@ -396,6 +496,30 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | |||
396 | return 0; | 496 | return 0; |
397 | } | 497 | } |
398 | 498 | ||
499 | static int vt8251_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | ||
500 | { | ||
501 | const struct ata_port_info *ppi[] = { &vt8251_port_info, NULL }; | ||
502 | struct ata_host *host; | ||
503 | int i, rc; | ||
504 | |||
505 | rc = ata_pci_sff_prepare_host(pdev, ppi, &host); | ||
506 | if (rc) | ||
507 | return rc; | ||
508 | *r_host = host; | ||
509 | |||
510 | rc = pcim_iomap_regions(pdev, 1 << 5, DRV_NAME); | ||
511 | if (rc) { | ||
512 | dev_printk(KERN_ERR, &pdev->dev, "failed to iomap PCI BAR 5\n"); | ||
513 | return rc; | ||
514 | } | ||
515 | |||
516 | /* 8251 hosts four sata ports as M/S of the two channels */ | ||
517 | for (i = 0; i < host->n_ports; i++) | ||
518 | ata_slave_link_init(host->ports[i]); | ||
519 | |||
520 | return 0; | ||
521 | } | ||
522 | |||
399 | static void svia_configure(struct pci_dev *pdev) | 523 | static void svia_configure(struct pci_dev *pdev) |
400 | { | 524 | { |
401 | u8 tmp8; | 525 | u8 tmp8; |
@@ -451,10 +575,10 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
451 | if (rc) | 575 | if (rc) |
452 | return rc; | 576 | return rc; |
453 | 577 | ||
454 | if (board_id == vt6420) | 578 | if (board_id == vt6421) |
455 | bar_sizes = &svia_bar_sizes[0]; | ||
456 | else | ||
457 | bar_sizes = &vt6421_bar_sizes[0]; | 579 | bar_sizes = &vt6421_bar_sizes[0]; |
580 | else | ||
581 | bar_sizes = &svia_bar_sizes[0]; | ||
458 | 582 | ||
459 | for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++) | 583 | for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++) |
460 | if ((pci_resource_start(pdev, i) == 0) || | 584 | if ((pci_resource_start(pdev, i) == 0) || |
@@ -467,12 +591,19 @@ static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
467 | return -ENODEV; | 591 | return -ENODEV; |
468 | } | 592 | } |
469 | 593 | ||
470 | if (board_id == vt6420) | 594 | switch (board_id) { |
595 | case vt6420: | ||
471 | rc = vt6420_prepare_host(pdev, &host); | 596 | rc = vt6420_prepare_host(pdev, &host); |
472 | else | 597 | break; |
598 | case vt6421: | ||
473 | rc = vt6421_prepare_host(pdev, &host); | 599 | rc = vt6421_prepare_host(pdev, &host); |
474 | if (rc) | 600 | break; |
475 | return rc; | 601 | case vt8251: |
602 | rc = vt8251_prepare_host(pdev, &host); | ||
603 | break; | ||
604 | default: | ||
605 | return -EINVAL; | ||
606 | } | ||
476 | 607 | ||
477 | svia_configure(pdev); | 608 | svia_configure(pdev); |
478 | 609 | ||
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 32f3a8ed8d3d..b936d8ce2728 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -443,8 +443,8 @@ static void bpa10x_destruct(struct hci_dev *hdev) | |||
443 | 443 | ||
444 | BT_DBG("%s", hdev->name); | 444 | BT_DBG("%s", hdev->name); |
445 | 445 | ||
446 | kfree(data->rx_skb[0]); | 446 | kfree_skb(data->rx_skb[0]); |
447 | kfree(data->rx_skb[1]); | 447 | kfree_skb(data->rx_skb[1]); |
448 | kfree(data); | 448 | kfree(data); |
449 | } | 449 | } |
450 | 450 | ||
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c index 9aaa86b232b1..2eecb779437b 100644 --- a/drivers/cdrom/gdrom.c +++ b/drivers/cdrom/gdrom.c | |||
@@ -495,9 +495,10 @@ static int gdrom_bdops_open(struct block_device *bdev, fmode_t mode) | |||
495 | return cdrom_open(gd.cd_info, bdev, mode); | 495 | return cdrom_open(gd.cd_info, bdev, mode); |
496 | } | 496 | } |
497 | 497 | ||
498 | static int gdrom_bdops_release(struct block_device *bdev, fmode_t mode) | 498 | static int gdrom_bdops_release(struct gendisk *disk, fmode_t mode) |
499 | { | 499 | { |
500 | return cdrom_release(gd.cd_info, mode); | 500 | cdrom_release(gd.cd_info, mode); |
501 | return 0; | ||
501 | } | 502 | } |
502 | 503 | ||
503 | static int gdrom_bdops_mediachanged(struct gendisk *disk) | 504 | static int gdrom_bdops_mediachanged(struct gendisk *disk) |
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 408f5f92cb4e..53fdc7ff3870 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -427,9 +427,6 @@ static int hpet_release(struct inode *inode, struct file *file) | |||
427 | if (irq) | 427 | if (irq) |
428 | free_irq(irq, devp); | 428 | free_irq(irq, devp); |
429 | 429 | ||
430 | if (file->f_flags & FASYNC) | ||
431 | hpet_fasync(-1, file, 0); | ||
432 | |||
433 | file->private_data = NULL; | 430 | file->private_data = NULL; |
434 | return 0; | 431 | return 0; |
435 | } | 432 | } |
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index 1d7b429f7ffa..41fc11dc921c 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
@@ -162,8 +162,6 @@ static int ipmi_release(struct inode *inode, struct file *file) | |||
162 | if (rv) | 162 | if (rv) |
163 | return rv; | 163 | return rv; |
164 | 164 | ||
165 | ipmi_fasync (-1, file, 0); | ||
166 | |||
167 | /* FIXME - free the messages in the list. */ | 165 | /* FIXME - free the messages in the list. */ |
168 | kfree(priv); | 166 | kfree(priv); |
169 | 167 | ||
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 235fab0bdf79..a4d57e31f713 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -870,7 +870,6 @@ static int ipmi_close(struct inode *ino, struct file *filep) | |||
870 | clear_bit(0, &ipmi_wdog_open); | 870 | clear_bit(0, &ipmi_wdog_open); |
871 | } | 871 | } |
872 | 872 | ||
873 | ipmi_fasync(-1, filep, 0); | ||
874 | expect_close = 0; | 873 | expect_close = 0; |
875 | 874 | ||
876 | return 0; | 875 | return 0; |
diff --git a/drivers/char/random.c b/drivers/char/random.c index 705a839f1796..675076f5fca8 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1139,18 +1139,12 @@ static int random_fasync(int fd, struct file *filp, int on) | |||
1139 | return fasync_helper(fd, filp, on, &fasync); | 1139 | return fasync_helper(fd, filp, on, &fasync); |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | static int random_release(struct inode *inode, struct file *filp) | ||
1143 | { | ||
1144 | return fasync_helper(-1, filp, 0, &fasync); | ||
1145 | } | ||
1146 | |||
1147 | const struct file_operations random_fops = { | 1142 | const struct file_operations random_fops = { |
1148 | .read = random_read, | 1143 | .read = random_read, |
1149 | .write = random_write, | 1144 | .write = random_write, |
1150 | .poll = random_poll, | 1145 | .poll = random_poll, |
1151 | .unlocked_ioctl = random_ioctl, | 1146 | .unlocked_ioctl = random_ioctl, |
1152 | .fasync = random_fasync, | 1147 | .fasync = random_fasync, |
1153 | .release = random_release, | ||
1154 | }; | 1148 | }; |
1155 | 1149 | ||
1156 | const struct file_operations urandom_fops = { | 1150 | const struct file_operations urandom_fops = { |
@@ -1158,7 +1152,6 @@ const struct file_operations urandom_fops = { | |||
1158 | .write = random_write, | 1152 | .write = random_write, |
1159 | .unlocked_ioctl = random_ioctl, | 1153 | .unlocked_ioctl = random_ioctl, |
1160 | .fasync = random_fasync, | 1154 | .fasync = random_fasync, |
1161 | .release = random_release, | ||
1162 | }; | 1155 | }; |
1163 | 1156 | ||
1164 | /*************************************************************** | 1157 | /*************************************************************** |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 32dc89720d58..20d6efb6324e 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -788,8 +788,6 @@ static int rtc_release(struct inode *inode, struct file *file) | |||
788 | } | 788 | } |
789 | spin_unlock_irq(&rtc_lock); | 789 | spin_unlock_irq(&rtc_lock); |
790 | 790 | ||
791 | if (file->f_flags & FASYNC) | ||
792 | rtc_fasync(-1, file, 0); | ||
793 | no_irq: | 791 | no_irq: |
794 | #endif | 792 | #endif |
795 | 793 | ||
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 85e0eb76eeab..2457b07dabd6 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -898,7 +898,6 @@ static int sonypi_misc_fasync(int fd, struct file *filp, int on) | |||
898 | 898 | ||
899 | static int sonypi_misc_release(struct inode *inode, struct file *file) | 899 | static int sonypi_misc_release(struct inode *inode, struct file *file) |
900 | { | 900 | { |
901 | sonypi_misc_fasync(-1, file, 0); | ||
902 | mutex_lock(&sonypi_device.lock); | 901 | mutex_lock(&sonypi_device.lock); |
903 | sonypi_device.open_count--; | 902 | sonypi_device.open_count--; |
904 | mutex_unlock(&sonypi_device.lock); | 903 | mutex_unlock(&sonypi_device.lock); |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 0d46627663b1..78eeed5caaff 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -406,8 +406,6 @@ int drm_release(struct inode *inode, struct file *filp) | |||
406 | if (dev->driver->driver_features & DRIVER_GEM) | 406 | if (dev->driver->driver_features & DRIVER_GEM) |
407 | drm_gem_release(dev, file_priv); | 407 | drm_gem_release(dev, file_priv); |
408 | 408 | ||
409 | drm_fasync(-1, filp, 0); | ||
410 | |||
411 | mutex_lock(&dev->ctxlist_mutex); | 409 | mutex_lock(&dev->ctxlist_mutex); |
412 | if (!list_empty(&dev->ctxlist)) { | 410 | if (!list_empty(&dev->ctxlist)) { |
413 | struct drm_ctx_list *pos, *n; | 411 | struct drm_ctx_list *pos, *n; |
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 3ac320785fc5..83e851a5ed30 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -242,8 +242,6 @@ static int hiddev_release(struct inode * inode, struct file * file) | |||
242 | struct hiddev_list *list = file->private_data; | 242 | struct hiddev_list *list = file->private_data; |
243 | unsigned long flags; | 243 | unsigned long flags; |
244 | 244 | ||
245 | hiddev_fasync(-1, file, 0); | ||
246 | |||
247 | spin_lock_irqsave(&list->hiddev->list_lock, flags); | 245 | spin_lock_irqsave(&list->hiddev->list_lock, flags); |
248 | list_del(&list->node); | 246 | list_del(&list->node); |
249 | spin_unlock_irqrestore(&list->hiddev->list_lock, flags); | 247 | spin_unlock_irqrestore(&list->hiddev->list_lock, flags); |
diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c index 2f83543a9dfc..965cfdb84ebc 100644 --- a/drivers/ieee1394/dv1394.c +++ b/drivers/ieee1394/dv1394.c | |||
@@ -1828,9 +1828,6 @@ static int dv1394_release(struct inode *inode, struct file *file) | |||
1828 | /* OK to free the DMA buffer, no more mappings can exist */ | 1828 | /* OK to free the DMA buffer, no more mappings can exist */ |
1829 | do_dv1394_shutdown(video, 1); | 1829 | do_dv1394_shutdown(video, 1); |
1830 | 1830 | ||
1831 | /* clean up async I/O users */ | ||
1832 | dv1394_fasync(-1, file, 0); | ||
1833 | |||
1834 | /* give someone else a turn */ | 1831 | /* give someone else a turn */ |
1835 | clear_bit(0, &video->open); | 1832 | clear_bit(0, &video->open); |
1836 | 1833 | ||
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index d85af1b67027..eb36a81dd09b 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -358,8 +358,6 @@ static int ib_uverbs_event_close(struct inode *inode, struct file *filp) | |||
358 | } | 358 | } |
359 | spin_unlock_irq(&file->lock); | 359 | spin_unlock_irq(&file->lock); |
360 | 360 | ||
361 | ib_uverbs_event_fasync(-1, filp, 0); | ||
362 | |||
363 | if (file->is_async) { | 361 | if (file->is_async) { |
364 | ib_unregister_event_handler(&file->uverbs_file->event_handler); | 362 | ib_unregister_event_handler(&file->uverbs_file->event_handler); |
365 | kref_put(&file->uverbs_file->ref, ib_uverbs_release_file); | 363 | kref_put(&file->uverbs_file->ref, ib_uverbs_release_file); |
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 3524bef62be6..1070db330d35 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -235,7 +235,6 @@ static int evdev_release(struct inode *inode, struct file *file) | |||
235 | evdev_ungrab(evdev, client); | 235 | evdev_ungrab(evdev, client); |
236 | mutex_unlock(&evdev->mutex); | 236 | mutex_unlock(&evdev->mutex); |
237 | 237 | ||
238 | evdev_fasync(-1, file, 0); | ||
239 | evdev_detach_client(evdev, client); | 238 | evdev_detach_client(evdev, client); |
240 | kfree(client); | 239 | kfree(client); |
241 | 240 | ||
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 65d7077a75a1..a85b1485e774 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -244,7 +244,6 @@ static int joydev_release(struct inode *inode, struct file *file) | |||
244 | struct joydev_client *client = file->private_data; | 244 | struct joydev_client *client = file->private_data; |
245 | struct joydev *joydev = client->joydev; | 245 | struct joydev *joydev = client->joydev; |
246 | 246 | ||
247 | joydev_fasync(-1, file, 0); | ||
248 | joydev_detach_client(joydev, client); | 247 | joydev_detach_client(joydev, client); |
249 | kfree(client); | 248 | kfree(client); |
250 | 249 | ||
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 82ec6b1b6467..216a559f55ea 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -71,7 +71,6 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, | |||
71 | static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait); | 71 | static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait); |
72 | 72 | ||
73 | static int hp_sdc_rtc_open(struct inode *inode, struct file *file); | 73 | static int hp_sdc_rtc_open(struct inode *inode, struct file *file); |
74 | static int hp_sdc_rtc_release(struct inode *inode, struct file *file); | ||
75 | static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on); | 74 | static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on); |
76 | 75 | ||
77 | static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off, | 76 | static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off, |
@@ -414,17 +413,6 @@ static int hp_sdc_rtc_open(struct inode *inode, struct file *file) | |||
414 | return 0; | 413 | return 0; |
415 | } | 414 | } |
416 | 415 | ||
417 | static int hp_sdc_rtc_release(struct inode *inode, struct file *file) | ||
418 | { | ||
419 | /* Turn off interrupts? */ | ||
420 | |||
421 | if (file->f_flags & FASYNC) { | ||
422 | hp_sdc_rtc_fasync (-1, file, 0); | ||
423 | } | ||
424 | |||
425 | return 0; | ||
426 | } | ||
427 | |||
428 | static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on) | 416 | static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on) |
429 | { | 417 | { |
430 | return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue); | 418 | return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue); |
@@ -680,7 +668,6 @@ static const struct file_operations hp_sdc_rtc_fops = { | |||
680 | .poll = hp_sdc_rtc_poll, | 668 | .poll = hp_sdc_rtc_poll, |
681 | .ioctl = hp_sdc_rtc_ioctl, | 669 | .ioctl = hp_sdc_rtc_ioctl, |
682 | .open = hp_sdc_rtc_open, | 670 | .open = hp_sdc_rtc_open, |
683 | .release = hp_sdc_rtc_release, | ||
684 | .fasync = hp_sdc_rtc_fasync, | 671 | .fasync = hp_sdc_rtc_fasync, |
685 | }; | 672 | }; |
686 | 673 | ||
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 8137e50ded87..d8c056fe7e98 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -519,7 +519,6 @@ static int mousedev_release(struct inode *inode, struct file *file) | |||
519 | struct mousedev_client *client = file->private_data; | 519 | struct mousedev_client *client = file->private_data; |
520 | struct mousedev *mousedev = client->mousedev; | 520 | struct mousedev *mousedev = client->mousedev; |
521 | 521 | ||
522 | mousedev_fasync(-1, file, 0); | ||
523 | mousedev_detach_client(mousedev, client); | 522 | mousedev_detach_client(mousedev, client); |
524 | kfree(client); | 523 | kfree(client); |
525 | 524 | ||
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index 470770c09260..06bbd0e74c6f 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
@@ -135,7 +135,6 @@ static int serio_raw_release(struct inode *inode, struct file *file) | |||
135 | 135 | ||
136 | mutex_lock(&serio_raw_mutex); | 136 | mutex_lock(&serio_raw_mutex); |
137 | 137 | ||
138 | serio_raw_fasync(-1, file, 0); | ||
139 | serio_raw_cleanup(serio_raw); | 138 | serio_raw_cleanup(serio_raw); |
140 | 139 | ||
141 | mutex_unlock(&serio_raw_mutex); | 140 | mutex_unlock(&serio_raw_mutex); |
diff --git a/drivers/leds/leds-hp-disk.c b/drivers/leds/leds-hp-disk.c index 74645ab15660..44fa757d8254 100644 --- a/drivers/leds/leds-hp-disk.c +++ b/drivers/leds/leds-hp-disk.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | #include <linux/input.h> | 28 | #include <linux/input.h> |
29 | #include <linux/kthread.h> | 29 | #include <linux/kthread.h> |
30 | #include <linux/version.h> | ||
31 | #include <linux/leds.h> | 30 | #include <linux/leds.h> |
32 | #include <acpi/acpi_drivers.h> | 31 | #include <acpi/acpi_drivers.h> |
33 | 32 | ||
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index f5233f3d9eff..b89f476cd0a9 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c | |||
@@ -559,12 +559,6 @@ mptctl_fasync(int fd, struct file *filep, int mode) | |||
559 | return ret; | 559 | return ret; |
560 | } | 560 | } |
561 | 561 | ||
562 | static int | ||
563 | mptctl_release(struct inode *inode, struct file *filep) | ||
564 | { | ||
565 | return fasync_helper(-1, filep, 0, &async_queue); | ||
566 | } | ||
567 | |||
568 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 562 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
569 | /* | 563 | /* |
570 | * MPT ioctl handler | 564 | * MPT ioctl handler |
@@ -2706,7 +2700,6 @@ mptctl_hp_targetinfo(unsigned long arg) | |||
2706 | static const struct file_operations mptctl_fops = { | 2700 | static const struct file_operations mptctl_fops = { |
2707 | .owner = THIS_MODULE, | 2701 | .owner = THIS_MODULE, |
2708 | .llseek = no_llseek, | 2702 | .llseek = no_llseek, |
2709 | .release = mptctl_release, | ||
2710 | .fasync = mptctl_fasync, | 2703 | .fasync = mptctl_fasync, |
2711 | .unlocked_ioctl = mptctl_ioctl, | 2704 | .unlocked_ioctl = mptctl_ioctl, |
2712 | #ifdef CONFIG_COMPAT | 2705 | #ifdef CONFIG_COMPAT |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index a3fabdbe6ca6..f3384c32b9a1 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -1097,28 +1097,17 @@ static int cfg_fasync(int fd, struct file *fp, int on) | |||
1097 | static int cfg_release(struct inode *inode, struct file *file) | 1097 | static int cfg_release(struct inode *inode, struct file *file) |
1098 | { | 1098 | { |
1099 | ulong id = (ulong) file->private_data; | 1099 | ulong id = (ulong) file->private_data; |
1100 | struct i2o_cfg_info *p1, *p2; | 1100 | struct i2o_cfg_info *p, **q; |
1101 | unsigned long flags; | 1101 | unsigned long flags; |
1102 | 1102 | ||
1103 | lock_kernel(); | 1103 | lock_kernel(); |
1104 | p1 = p2 = NULL; | ||
1105 | |||
1106 | spin_lock_irqsave(&i2o_config_lock, flags); | 1104 | spin_lock_irqsave(&i2o_config_lock, flags); |
1107 | for (p1 = open_files; p1;) { | 1105 | for (q = &open_files; (p = *q) != NULL; q = &p->next) { |
1108 | if (p1->q_id == id) { | 1106 | if (p->q_id == id) { |
1109 | 1107 | *q = p->next; | |
1110 | if (p1->fasync) | 1108 | kfree(p); |
1111 | cfg_fasync(-1, file, 0); | ||
1112 | if (p2) | ||
1113 | p2->next = p1->next; | ||
1114 | else | ||
1115 | open_files = p1->next; | ||
1116 | |||
1117 | kfree(p1); | ||
1118 | break; | 1109 | break; |
1119 | } | 1110 | } |
1120 | p2 = p1; | ||
1121 | p1 = p1->next; | ||
1122 | } | 1111 | } |
1123 | spin_unlock_irqrestore(&i2o_config_lock, flags); | 1112 | spin_unlock_irqrestore(&i2o_config_lock, flags); |
1124 | unlock_kernel(); | 1113 | unlock_kernel(); |
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index b550267c8d5e..257277394f8c 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig | |||
@@ -81,7 +81,7 @@ config MFD_TMIO | |||
81 | 81 | ||
82 | config MFD_T7L66XB | 82 | config MFD_T7L66XB |
83 | bool "Support Toshiba T7L66XB" | 83 | bool "Support Toshiba T7L66XB" |
84 | depends on ARM | 84 | depends on ARM && HAVE_CLK |
85 | select MFD_CORE | 85 | select MFD_CORE |
86 | select MFD_TMIO | 86 | select MFD_TMIO |
87 | help | 87 | help |
@@ -89,7 +89,7 @@ config MFD_T7L66XB | |||
89 | 89 | ||
90 | config MFD_TC6387XB | 90 | config MFD_TC6387XB |
91 | bool "Support Toshiba TC6387XB" | 91 | bool "Support Toshiba TC6387XB" |
92 | depends on ARM | 92 | depends on ARM && HAVE_CLK |
93 | select MFD_CORE | 93 | select MFD_CORE |
94 | select MFD_TMIO | 94 | select MFD_TMIO |
95 | help | 95 | help |
diff --git a/drivers/misc/panasonic-laptop.c b/drivers/misc/panasonic-laptop.c index a2cb598d8ab5..4a1bc64485d5 100644 --- a/drivers/misc/panasonic-laptop.c +++ b/drivers/misc/panasonic-laptop.c | |||
@@ -116,7 +116,6 @@ | |||
116 | * | 116 | * |
117 | */ | 117 | */ |
118 | 118 | ||
119 | #include <linux/version.h> | ||
120 | #include <linux/kernel.h> | 119 | #include <linux/kernel.h> |
121 | #include <linux/module.h> | 120 | #include <linux/module.h> |
122 | #include <linux/init.h> | 121 | #include <linux/init.h> |
diff --git a/drivers/misc/sony-laptop.c b/drivers/misc/sony-laptop.c index f483c4221f76..06f07e19dc70 100644 --- a/drivers/misc/sony-laptop.c +++ b/drivers/misc/sony-laptop.c | |||
@@ -1920,7 +1920,6 @@ static int sonypi_misc_fasync(int fd, struct file *filp, int on) | |||
1920 | 1920 | ||
1921 | static int sonypi_misc_release(struct inode *inode, struct file *file) | 1921 | static int sonypi_misc_release(struct inode *inode, struct file *file) |
1922 | { | 1922 | { |
1923 | sonypi_misc_fasync(-1, file, 0); | ||
1924 | atomic_dec(&sonypi_compat.open_count); | 1923 | atomic_dec(&sonypi_compat.open_count); |
1925 | return 0; | 1924 | return 0; |
1926 | } | 1925 | } |
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 3a7bc524af33..c7a4f3bcc2bc 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -94,7 +94,7 @@ | |||
94 | #include <asm/io.h> | 94 | #include <asm/io.h> |
95 | #include <asm/irq.h> | 95 | #include <asm/irq.h> |
96 | 96 | ||
97 | static char version[] __initdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; | 97 | static char version[] __devinitdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n"; |
98 | 98 | ||
99 | #ifdef EL3_DEBUG | 99 | #ifdef EL3_DEBUG |
100 | static int el3_debug = EL3_DEBUG; | 100 | static int el3_debug = EL3_DEBUG; |
@@ -186,7 +186,7 @@ static int max_interrupt_work = 10; | |||
186 | static int nopnp; | 186 | static int nopnp; |
187 | #endif | 187 | #endif |
188 | 188 | ||
189 | static int __init el3_common_init(struct net_device *dev); | 189 | static int __devinit el3_common_init(struct net_device *dev); |
190 | static void el3_common_remove(struct net_device *dev); | 190 | static void el3_common_remove(struct net_device *dev); |
191 | static ushort id_read_eeprom(int index); | 191 | static ushort id_read_eeprom(int index); |
192 | static ushort read_eeprom(int ioaddr, int index); | 192 | static ushort read_eeprom(int ioaddr, int index); |
@@ -537,7 +537,7 @@ static struct mca_driver el3_mca_driver = { | |||
537 | static int mca_registered; | 537 | static int mca_registered; |
538 | #endif /* CONFIG_MCA */ | 538 | #endif /* CONFIG_MCA */ |
539 | 539 | ||
540 | static int __init el3_common_init(struct net_device *dev) | 540 | static int __devinit el3_common_init(struct net_device *dev) |
541 | { | 541 | { |
542 | struct el3_private *lp = netdev_priv(dev); | 542 | struct el3_private *lp = netdev_priv(dev); |
543 | int err; | 543 | int err; |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index ba1be0b3a8c8..07a6697e3635 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -644,10 +644,6 @@ This function frees the transmiter and receiver descriptor rings. | |||
644 | */ | 644 | */ |
645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) | 645 | static void amd8111e_free_ring(struct amd8111e_priv* lp) |
646 | { | 646 | { |
647 | |||
648 | /* Free transmit and receive skbs */ | ||
649 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
650 | |||
651 | /* Free transmit and receive descriptor rings */ | 647 | /* Free transmit and receive descriptor rings */ |
652 | if(lp->rx_ring){ | 648 | if(lp->rx_ring){ |
653 | pci_free_consistent(lp->pci_dev, | 649 | pci_free_consistent(lp->pci_dev, |
@@ -1233,7 +1229,9 @@ static int amd8111e_close(struct net_device * dev) | |||
1233 | 1229 | ||
1234 | amd8111e_disable_interrupt(lp); | 1230 | amd8111e_disable_interrupt(lp); |
1235 | amd8111e_stop_chip(lp); | 1231 | amd8111e_stop_chip(lp); |
1236 | amd8111e_free_ring(lp); | 1232 | |
1233 | /* Free transmit and receive skbs */ | ||
1234 | amd8111e_free_skbs(lp->amd8111e_net_dev); | ||
1237 | 1235 | ||
1238 | netif_carrier_off(lp->amd8111e_net_dev); | 1236 | netif_carrier_off(lp->amd8111e_net_dev); |
1239 | 1237 | ||
@@ -1243,6 +1241,7 @@ static int amd8111e_close(struct net_device * dev) | |||
1243 | 1241 | ||
1244 | spin_unlock_irq(&lp->lock); | 1242 | spin_unlock_irq(&lp->lock); |
1245 | free_irq(dev->irq, dev); | 1243 | free_irq(dev->irq, dev); |
1244 | amd8111e_free_ring(lp); | ||
1246 | 1245 | ||
1247 | /* Update the statistics before closing */ | 1246 | /* Update the statistics before closing */ |
1248 | amd8111e_get_stats(dev); | 1247 | amd8111e_get_stats(dev); |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 0fa53464efb2..6f431a887e7e 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -1080,7 +1080,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1080 | init_timer(&lp->check_timer); | 1080 | init_timer(&lp->check_timer); |
1081 | lp->check_timer.data = (unsigned long)dev; | 1081 | lp->check_timer.data = (unsigned long)dev; |
1082 | lp->check_timer.function = at91ether_check_link; | 1082 | lp->check_timer.function = at91ether_check_link; |
1083 | } | 1083 | } else if (lp->board_data.phy_irq_pin >= 32) |
1084 | gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy"); | ||
1084 | 1085 | ||
1085 | /* Display ethernet banner */ | 1086 | /* Display ethernet banner */ |
1086 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", | 1087 | printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", |
@@ -1167,6 +1168,9 @@ static int __devexit at91ether_remove(struct platform_device *pdev) | |||
1167 | struct net_device *dev = platform_get_drvdata(pdev); | 1168 | struct net_device *dev = platform_get_drvdata(pdev); |
1168 | struct at91_private *lp = netdev_priv(dev); | 1169 | struct at91_private *lp = netdev_priv(dev); |
1169 | 1170 | ||
1171 | if (lp->board_data.phy_irq_pin >= 32) | ||
1172 | gpio_free(lp->board_data.phy_irq_pin); | ||
1173 | |||
1170 | unregister_netdev(dev); | 1174 | unregister_netdev(dev); |
1171 | free_irq(dev->irq, dev); | 1175 | free_irq(dev->irq, dev); |
1172 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); | 1176 | dma_free_coherent(NULL, sizeof(struct recv_desc_bufs), lp->dlist, (dma_addr_t)lp->dlist_phys); |
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c index 3cf59a7f5a1c..246d92b42636 100644 --- a/drivers/net/atlx/atl1.c +++ b/drivers/net/atlx/atl1.c | |||
@@ -2310,7 +2310,8 @@ static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count, | |||
2310 | if (tpd != ptpd) | 2310 | if (tpd != ptpd) |
2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); | 2311 | memcpy(tpd, ptpd, sizeof(struct tx_packet_desc)); |
2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); | 2312 | tpd->buffer_addr = cpu_to_le64(buffer_info->dma); |
2313 | tpd->word2 = (cpu_to_le16(buffer_info->length) & | 2313 | tpd->word2 &= ~(TPD_BUFLEN_MASK << TPD_BUFLEN_SHIFT); |
2314 | tpd->word2 |= (cpu_to_le16(buffer_info->length) & | ||
2314 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; | 2315 | TPD_BUFLEN_MASK) << TPD_BUFLEN_SHIFT; |
2315 | 2316 | ||
2316 | /* | 2317 | /* |
@@ -2409,8 +2410,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2409 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | | 2410 | vlan_tag = (vlan_tag << 4) | (vlan_tag >> 13) | |
2410 | ((vlan_tag >> 9) & 0x8); | 2411 | ((vlan_tag >> 9) & 0x8); |
2411 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; | 2412 | ptpd->word3 |= 1 << TPD_INS_VL_TAG_SHIFT; |
2412 | ptpd->word3 |= (vlan_tag & TPD_VL_TAGGED_MASK) << | 2413 | ptpd->word2 |= (vlan_tag & TPD_VLANTAG_MASK) << |
2413 | TPD_VL_TAGGED_SHIFT; | 2414 | TPD_VLANTAG_SHIFT; |
2414 | } | 2415 | } |
2415 | 2416 | ||
2416 | tso = atl1_tso(adapter, skb, ptpd); | 2417 | tso = atl1_tso(adapter, skb, ptpd); |
diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h index a5015b14a429..ffa73fc8d95e 100644 --- a/drivers/net/atlx/atl1.h +++ b/drivers/net/atlx/atl1.h | |||
@@ -504,7 +504,7 @@ struct rx_free_desc { | |||
504 | #define TPD_PKTNT_MASK 0x0001 | 504 | #define TPD_PKTNT_MASK 0x0001 |
505 | #define TPD_PKTINT_SHIFT 15 | 505 | #define TPD_PKTINT_SHIFT 15 |
506 | #define TPD_VLANTAG_MASK 0xFFFF | 506 | #define TPD_VLANTAG_MASK 0xFFFF |
507 | #define TPD_VLAN_SHIFT 16 | 507 | #define TPD_VLANTAG_SHIFT 16 |
508 | 508 | ||
509 | /* tpd word 3 bits 0:13 */ | 509 | /* tpd word 3 bits 0:13 */ |
510 | #define TPD_EOP_MASK 0x0001 | 510 | #define TPD_EOP_MASK 0x0001 |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index ade5f3f6693b..87437c788476 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -169,11 +169,14 @@ static void tlb_clear_slave(struct bonding *bond, struct slave *slave, int save_ | |||
169 | /* clear slave from tx_hashtbl */ | 169 | /* clear slave from tx_hashtbl */ |
170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; | 170 | tx_hash_table = BOND_ALB_INFO(bond).tx_hashtbl; |
171 | 171 | ||
172 | index = SLAVE_TLB_INFO(slave).head; | 172 | /* skip this if we've already freed the tx hash table */ |
173 | while (index != TLB_NULL_INDEX) { | 173 | if (tx_hash_table) { |
174 | u32 next_index = tx_hash_table[index].next; | 174 | index = SLAVE_TLB_INFO(slave).head; |
175 | tlb_init_table_entry(&tx_hash_table[index], save_load); | 175 | while (index != TLB_NULL_INDEX) { |
176 | index = next_index; | 176 | u32 next_index = tx_hash_table[index].next; |
177 | tlb_init_table_entry(&tx_hash_table[index], save_load); | ||
178 | index = next_index; | ||
179 | } | ||
177 | } | 180 | } |
178 | 181 | ||
179 | tlb_init_slave(slave); | 182 | tlb_init_slave(slave); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 832739f38db4..a3efba59eee9 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1979,6 +1979,20 @@ void bond_destroy(struct bonding *bond) | |||
1979 | unregister_netdevice(bond->dev); | 1979 | unregister_netdevice(bond->dev); |
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | static void bond_destructor(struct net_device *bond_dev) | ||
1983 | { | ||
1984 | struct bonding *bond = bond_dev->priv; | ||
1985 | |||
1986 | if (bond->wq) | ||
1987 | destroy_workqueue(bond->wq); | ||
1988 | |||
1989 | netif_addr_lock_bh(bond_dev); | ||
1990 | bond_mc_list_destroy(bond); | ||
1991 | netif_addr_unlock_bh(bond_dev); | ||
1992 | |||
1993 | free_netdev(bond_dev); | ||
1994 | } | ||
1995 | |||
1982 | /* | 1996 | /* |
1983 | * First release a slave and than destroy the bond if no more slaves iare left. | 1997 | * First release a slave and than destroy the bond if no more slaves iare left. |
1984 | * Must be under rtnl_lock when this function is called. | 1998 | * Must be under rtnl_lock when this function is called. |
@@ -2376,6 +2390,9 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2376 | continue; | 2390 | continue; |
2377 | 2391 | ||
2378 | case BOND_LINK_DOWN: | 2392 | case BOND_LINK_DOWN: |
2393 | if (slave->link_failure_count < UINT_MAX) | ||
2394 | slave->link_failure_count++; | ||
2395 | |||
2379 | slave->link = BOND_LINK_DOWN; | 2396 | slave->link = BOND_LINK_DOWN; |
2380 | 2397 | ||
2381 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || | 2398 | if (bond->params.mode == BOND_MODE_ACTIVEBACKUP || |
@@ -4550,7 +4567,7 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4550 | 4567 | ||
4551 | bond_set_mode_ops(bond, bond->params.mode); | 4568 | bond_set_mode_ops(bond, bond->params.mode); |
4552 | 4569 | ||
4553 | bond_dev->destructor = free_netdev; | 4570 | bond_dev->destructor = bond_destructor; |
4554 | 4571 | ||
4555 | /* Initialize the device options */ | 4572 | /* Initialize the device options */ |
4556 | bond_dev->tx_queue_len = 0; | 4573 | bond_dev->tx_queue_len = 0; |
@@ -4589,20 +4606,6 @@ static int bond_init(struct net_device *bond_dev, struct bond_params *params) | |||
4589 | return 0; | 4606 | return 0; |
4590 | } | 4607 | } |
4591 | 4608 | ||
4592 | /* De-initialize device specific data. | ||
4593 | * Caller must hold rtnl_lock. | ||
4594 | */ | ||
4595 | static void bond_deinit(struct net_device *bond_dev) | ||
4596 | { | ||
4597 | struct bonding *bond = bond_dev->priv; | ||
4598 | |||
4599 | list_del(&bond->bond_list); | ||
4600 | |||
4601 | #ifdef CONFIG_PROC_FS | ||
4602 | bond_remove_proc_entry(bond); | ||
4603 | #endif | ||
4604 | } | ||
4605 | |||
4606 | static void bond_work_cancel_all(struct bonding *bond) | 4609 | static void bond_work_cancel_all(struct bonding *bond) |
4607 | { | 4610 | { |
4608 | write_lock_bh(&bond->lock); | 4611 | write_lock_bh(&bond->lock); |
@@ -4624,6 +4627,22 @@ static void bond_work_cancel_all(struct bonding *bond) | |||
4624 | cancel_delayed_work(&bond->ad_work); | 4627 | cancel_delayed_work(&bond->ad_work); |
4625 | } | 4628 | } |
4626 | 4629 | ||
4630 | /* De-initialize device specific data. | ||
4631 | * Caller must hold rtnl_lock. | ||
4632 | */ | ||
4633 | static void bond_deinit(struct net_device *bond_dev) | ||
4634 | { | ||
4635 | struct bonding *bond = bond_dev->priv; | ||
4636 | |||
4637 | list_del(&bond->bond_list); | ||
4638 | |||
4639 | bond_work_cancel_all(bond); | ||
4640 | |||
4641 | #ifdef CONFIG_PROC_FS | ||
4642 | bond_remove_proc_entry(bond); | ||
4643 | #endif | ||
4644 | } | ||
4645 | |||
4627 | /* Unregister and free all bond devices. | 4646 | /* Unregister and free all bond devices. |
4628 | * Caller must hold rtnl_lock. | 4647 | * Caller must hold rtnl_lock. |
4629 | */ | 4648 | */ |
@@ -4635,9 +4654,6 @@ static void bond_free_all(void) | |||
4635 | struct net_device *bond_dev = bond->dev; | 4654 | struct net_device *bond_dev = bond->dev; |
4636 | 4655 | ||
4637 | bond_work_cancel_all(bond); | 4656 | bond_work_cancel_all(bond); |
4638 | netif_addr_lock_bh(bond_dev); | ||
4639 | bond_mc_list_destroy(bond); | ||
4640 | netif_addr_unlock_bh(bond_dev); | ||
4641 | /* Release the bonded slaves */ | 4657 | /* Release the bonded slaves */ |
4642 | bond_release_all(bond_dev); | 4658 | bond_release_all(bond_dev); |
4643 | bond_destroy(bond); | 4659 | bond_destroy(bond); |
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c index 65d0a9103297..7e8a63106bdf 100644 --- a/drivers/net/cris/eth_v10.c +++ b/drivers/net/cris/eth_v10.c | |||
@@ -32,14 +32,14 @@ | |||
32 | #include <linux/skbuff.h> | 32 | #include <linux/skbuff.h> |
33 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> |
34 | 34 | ||
35 | #include <asm/arch/svinto.h>/* DMA and register descriptions */ | 35 | #include <arch/svinto.h>/* DMA and register descriptions */ |
36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ | 36 | #include <asm/io.h> /* CRIS_LED_* I/O functions */ |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | #include <asm/dma.h> | 38 | #include <asm/dma.h> |
39 | #include <asm/system.h> | 39 | #include <asm/system.h> |
40 | #include <asm/ethernet.h> | 40 | #include <asm/ethernet.h> |
41 | #include <asm/cache.h> | 41 | #include <asm/cache.h> |
42 | #include <asm/arch/io_interface_mux.h> | 42 | #include <arch/io_interface_mux.h> |
43 | 43 | ||
44 | //#define ETHDEBUG | 44 | //#define ETHDEBUG |
45 | #define D(x) | 45 | #define D(x) |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 64b201134fdb..83a5cb6aa23b 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -586,6 +586,18 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
586 | struct gfar_mii __iomem *regs = | 586 | struct gfar_mii __iomem *regs = |
587 | (void __iomem *)&priv->regs->gfar_mii_regs; | 587 | (void __iomem *)&priv->regs->gfar_mii_regs; |
588 | int tbipa = gfar_read(&priv->regs->tbipa); | 588 | int tbipa = gfar_read(&priv->regs->tbipa); |
589 | struct mii_bus *bus = gfar_get_miibus(priv); | ||
590 | |||
591 | if (bus) | ||
592 | mutex_lock(&bus->mdio_lock); | ||
593 | |||
594 | /* If the link is already up, we must already be ok, and don't need to | ||
595 | * configure and reset the TBI<->SerDes link. Maybe U-Boot configured | ||
596 | * everything for us? Resetting it takes the link down and requires | ||
597 | * several seconds for it to come back. | ||
598 | */ | ||
599 | if (gfar_local_mdio_read(regs, tbipa, MII_BMSR) & BMSR_LSTATUS) | ||
600 | goto done; | ||
589 | 601 | ||
590 | /* Single clk mode, mii mode off(for serdes communication) */ | 602 | /* Single clk mode, mii mode off(for serdes communication) */ |
591 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); | 603 | gfar_local_mdio_write(regs, tbipa, MII_TBICON, TBICON_CLK_SELECT); |
@@ -596,6 +608,10 @@ static void gfar_configure_serdes(struct net_device *dev) | |||
596 | 608 | ||
597 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | | 609 | gfar_local_mdio_write(regs, tbipa, MII_BMCR, BMCR_ANENABLE | |
598 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); | 610 | BMCR_ANRESTART | BMCR_FULLDPLX | BMCR_SPEED1000); |
611 | |||
612 | done: | ||
613 | if (bus) | ||
614 | mutex_unlock(&bus->mdio_lock); | ||
599 | } | 615 | } |
600 | 616 | ||
601 | static void init_registers(struct net_device *dev) | 617 | static void init_registers(struct net_device *dev) |
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index bf73eea98010..0e2595d24933 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c | |||
@@ -269,6 +269,27 @@ static struct device_driver gianfar_mdio_driver = { | |||
269 | .remove = gfar_mdio_remove, | 269 | .remove = gfar_mdio_remove, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int match_mdio_bus(struct device *dev, void *data) | ||
273 | { | ||
274 | const struct gfar_private *priv = data; | ||
275 | const struct platform_device *pdev = to_platform_device(dev); | ||
276 | |||
277 | return !strcmp(pdev->name, gianfar_mdio_driver.name) && | ||
278 | pdev->id == priv->einfo->mdio_bus; | ||
279 | } | ||
280 | |||
281 | /* Given a gfar_priv structure, find the mii_bus controlled by this device (not | ||
282 | * necessarily the same as the bus the gfar's PHY is on), if one exists. | ||
283 | * Normally only the first gianfar controls a mii_bus. */ | ||
284 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv) | ||
285 | { | ||
286 | /*const*/ struct device *d; | ||
287 | |||
288 | d = bus_find_device(gianfar_mdio_driver.bus, NULL, (void *)priv, | ||
289 | match_mdio_bus); | ||
290 | return d ? dev_get_drvdata(d) : NULL; | ||
291 | } | ||
292 | |||
272 | int __init gfar_mdio_init(void) | 293 | int __init gfar_mdio_init(void) |
273 | { | 294 | { |
274 | return driver_register(&gianfar_mdio_driver); | 295 | return driver_register(&gianfar_mdio_driver); |
diff --git a/drivers/net/gianfar_mii.h b/drivers/net/gianfar_mii.h index 2af28b16a0e2..02dc970ca1ff 100644 --- a/drivers/net/gianfar_mii.h +++ b/drivers/net/gianfar_mii.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #ifndef __GIANFAR_MII_H | 18 | #ifndef __GIANFAR_MII_H |
19 | #define __GIANFAR_MII_H | 19 | #define __GIANFAR_MII_H |
20 | 20 | ||
21 | struct gfar_private; /* forward ref */ | ||
22 | |||
21 | #define MIIMIND_BUSY 0x00000001 | 23 | #define MIIMIND_BUSY 0x00000001 |
22 | #define MIIMIND_NOTVALID 0x00000004 | 24 | #define MIIMIND_NOTVALID 0x00000004 |
23 | 25 | ||
@@ -44,6 +46,7 @@ int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | |||
44 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, | 46 | int gfar_local_mdio_write(struct gfar_mii __iomem *regs, int mii_id, |
45 | int regnum, u16 value); | 47 | int regnum, u16 value); |
46 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); | 48 | int gfar_local_mdio_read(struct gfar_mii __iomem *regs, int mii_id, int regnum); |
49 | struct mii_bus *gfar_get_miibus(const struct gfar_private *priv); | ||
47 | int __init gfar_mdio_init(void); | 50 | int __init gfar_mdio_init(void); |
48 | void gfar_mdio_exit(void); | 51 | void gfar_mdio_exit(void); |
49 | #endif /* GIANFAR_PHY_H */ | 52 | #endif /* GIANFAR_PHY_H */ |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 2482d61662a2..2e67ae015d91 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -118,7 +118,6 @@ | |||
118 | #include <linux/errno.h> | 118 | #include <linux/errno.h> |
119 | #include <linux/init.h> | 119 | #include <linux/init.h> |
120 | #include <linux/slab.h> | 120 | #include <linux/slab.h> |
121 | #include <linux/module.h> | ||
122 | #include <linux/kref.h> | 121 | #include <linux/kref.h> |
123 | #include <linux/usb.h> | 122 | #include <linux/usb.h> |
124 | #include <linux/device.h> | 123 | #include <linux/device.h> |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 1e0de93fd618..3843b5faba8b 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -82,7 +82,6 @@ | |||
82 | #include <linux/errno.h> | 82 | #include <linux/errno.h> |
83 | #include <linux/init.h> | 83 | #include <linux/init.h> |
84 | #include <linux/slab.h> | 84 | #include <linux/slab.h> |
85 | #include <linux/module.h> | ||
86 | #include <linux/kref.h> | 85 | #include <linux/kref.h> |
87 | #include <linux/usb.h> | 86 | #include <linux/usb.h> |
88 | #include <linux/device.h> | 87 | #include <linux/device.h> |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 3b43bfd85a0f..b1ac63ab8c16 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -76,15 +76,6 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
76 | 76 | ||
77 | skb->protocol = eth_type_trans(skb,dev); | 77 | skb->protocol = eth_type_trans(skb,dev); |
78 | 78 | ||
79 | #ifdef LOOPBACK_TSO | ||
80 | if (skb_is_gso(skb)) { | ||
81 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | ||
82 | BUG_ON(ip_hdr(skb)->protocol != IPPROTO_TCP); | ||
83 | |||
84 | emulate_large_send_offload(skb); | ||
85 | return 0; | ||
86 | } | ||
87 | #endif | ||
88 | dev->last_rx = jiffies; | 79 | dev->last_rx = jiffies; |
89 | 80 | ||
90 | /* it's OK to use per_cpu_ptr() because BHs are off */ | 81 | /* it's OK to use per_cpu_ptr() because BHs are off */ |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index b1556b2e404c..a5f428bcc0eb 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.3-1.371" | 78 | #define MYRI10GE_VERSION_STR "1.4.3-1.375" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -1393,6 +1393,7 @@ myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) | |||
1393 | if (tx->req == tx->done) { | 1393 | if (tx->req == tx->done) { |
1394 | tx->queue_active = 0; | 1394 | tx->queue_active = 0; |
1395 | put_be32(htonl(1), tx->send_stop); | 1395 | put_be32(htonl(1), tx->send_stop); |
1396 | mmiowb(); | ||
1396 | } | 1397 | } |
1397 | __netif_tx_unlock(dev_queue); | 1398 | __netif_tx_unlock(dev_queue); |
1398 | } | 1399 | } |
@@ -2864,6 +2865,7 @@ again: | |||
2864 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { | 2865 | if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { |
2865 | tx->queue_active = 1; | 2866 | tx->queue_active = 1; |
2866 | put_be32(htonl(1), tx->send_go); | 2867 | put_be32(htonl(1), tx->send_go); |
2868 | mmiowb(); | ||
2867 | } | 2869 | } |
2868 | tx->pkt_start++; | 2870 | tx->pkt_start++; |
2869 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { | 2871 | if ((avail - count) < MXGEFW_MAX_SEND_DESC) { |
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index fc6f4b8c64b3..b646e92134dc 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -399,11 +399,11 @@ static int pppoe_rcv(struct sk_buff *skb, | |||
399 | if (skb->len < len) | 399 | if (skb->len < len) |
400 | goto drop; | 400 | goto drop; |
401 | 401 | ||
402 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); | 402 | if (pskb_trim_rcsum(skb, len)) |
403 | if (!po) | ||
404 | goto drop; | 403 | goto drop; |
405 | 404 | ||
406 | if (pskb_trim_rcsum(skb, len)) | 405 | po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex); |
406 | if (!po) | ||
407 | goto drop; | 407 | goto drop; |
408 | 408 | ||
409 | return sk_receive_skb(sk_pppox(po), skb, 0); | 409 | return sk_receive_skb(sk_pppox(po), skb, 0); |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index c70870e0fd61..6f9895d4e5bd 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2060,7 +2060,6 @@ static int smc_request_attrib(struct platform_device *pdev, | |||
2060 | struct net_device *ndev) | 2060 | struct net_device *ndev) |
2061 | { | 2061 | { |
2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2062 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2063 | struct smc_local *lp = netdev_priv(ndev); | ||
2064 | 2063 | ||
2065 | if (!res) | 2064 | if (!res) |
2066 | return 0; | 2065 | return 0; |
@@ -2075,7 +2074,6 @@ static void smc_release_attrib(struct platform_device *pdev, | |||
2075 | struct net_device *ndev) | 2074 | struct net_device *ndev) |
2076 | { | 2075 | { |
2077 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); | 2076 | struct resource * res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smc91x-attrib"); |
2078 | struct smc_local *lp = netdev_priv(ndev); | ||
2079 | 2077 | ||
2080 | if (res) | 2078 | if (res) |
2081 | release_mem_region(res->start, ATTRIB_SIZE); | 2079 | release_mem_region(res->start, ATTRIB_SIZE); |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 6daea0c91862..33b6d1b122fb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1070,8 +1070,6 @@ static int tun_chr_close(struct inode *inode, struct file *file) | |||
1070 | 1070 | ||
1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); | 1071 | DBG(KERN_INFO "%s: tun_chr_close\n", tun->dev->name); |
1072 | 1072 | ||
1073 | tun_chr_fasync(-1, file, 0); | ||
1074 | |||
1075 | rtnl_lock(); | 1073 | rtnl_lock(); |
1076 | 1074 | ||
1077 | /* Detach from net device */ | 1075 | /* Detach from net device */ |
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index ccd9cd35ecbe..5bf7e01ef0e9 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c | |||
@@ -695,7 +695,6 @@ EXPORT_SYMBOL(z8530_nop); | |||
695 | * z8530_interrupt - Handle an interrupt from a Z8530 | 695 | * z8530_interrupt - Handle an interrupt from a Z8530 |
696 | * @irq: Interrupt number | 696 | * @irq: Interrupt number |
697 | * @dev_id: The Z8530 device that is interrupting. | 697 | * @dev_id: The Z8530 device that is interrupting. |
698 | * @regs: unused | ||
699 | * | 698 | * |
700 | * A Z85[2]30 device has stuck its hand in the air for attention. | 699 | * A Z85[2]30 device has stuck its hand in the air for attention. |
701 | * We scan both the channels on the chip for events and then call | 700 | * We scan both the channels on the chip for events and then call |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index cfd4d052d666..9e47d727e220 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -2942,10 +2942,8 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw, | |||
2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && | 2942 | sc->opmode != NL80211_IFTYPE_MESH_POINT && |
2943 | test_bit(ATH_STAT_PROMISC, sc->status)) | 2943 | test_bit(ATH_STAT_PROMISC, sc->status)) |
2944 | rfilt |= AR5K_RX_FILTER_PROM; | 2944 | rfilt |= AR5K_RX_FILTER_PROM; |
2945 | if (sc->opmode == NL80211_IFTYPE_STATION || | 2945 | if (sc->opmode == NL80211_IFTYPE_ADHOC) |
2946 | sc->opmode == NL80211_IFTYPE_ADHOC) { | ||
2947 | rfilt |= AR5K_RX_FILTER_BEACON; | 2946 | rfilt |= AR5K_RX_FILTER_BEACON; |
2948 | } | ||
2949 | 2947 | ||
2950 | /* Set filters */ | 2948 | /* Set filters */ |
2951 | ath5k_hw_set_rx_filter(ah,rfilt); | 2949 | ath5k_hw_set_rx_filter(ah,rfilt); |
diff --git a/drivers/net/wireless/ath5k/debug.c b/drivers/net/wireless/ath5k/debug.c index 8f92d670f614..19980cbd5d5f 100644 --- a/drivers/net/wireless/ath5k/debug.c +++ b/drivers/net/wireless/ath5k/debug.c | |||
@@ -339,7 +339,7 @@ static struct { | |||
339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, | 339 | { ATH5K_DEBUG_BEACON, "beacon", "beacon handling" }, |
340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, | 340 | { ATH5K_DEBUG_CALIBRATE, "calib", "periodic calibration" }, |
341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, | 341 | { ATH5K_DEBUG_TXPOWER, "txpower", "transmit power setting" }, |
342 | { ATH5K_DEBUG_LED, "led", "LED mamagement" }, | 342 | { ATH5K_DEBUG_LED, "led", "LED management" }, |
343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, | 343 | { ATH5K_DEBUG_DUMP_RX, "dumprx", "print received skb content" }, |
344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, | 344 | { ATH5K_DEBUG_DUMP_TX, "dumptx", "print transmit skb content" }, |
345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, | 345 | { ATH5K_DEBUG_DUMPBANDS, "dumpbands", "dump bands" }, |
diff --git a/drivers/net/wireless/ath5k/initvals.c b/drivers/net/wireless/ath5k/initvals.c index ea2e1a20b499..ceaa6c475c06 100644 --- a/drivers/net/wireless/ath5k/initvals.c +++ b/drivers/net/wireless/ath5k/initvals.c | |||
@@ -806,6 +806,8 @@ static const struct ath5k_ini_mode ar5212_rf5111_ini_mode_end[] = { | |||
806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, | 806 | { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 } }, |
807 | { AR5K_PHY(642), | 807 | { AR5K_PHY(642), |
808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, | 808 | { 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788, 0xd03e6788 } }, |
809 | { 0xa228, | ||
810 | { 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5, 0x000001b5 } }, | ||
809 | { 0xa23c, | 811 | { 0xa23c, |
810 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, | 812 | { 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af, 0x13c889af } }, |
811 | }; | 813 | }; |
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c index 8f1886834e61..1b6d45b6772d 100644 --- a/drivers/net/wireless/ath5k/reset.c +++ b/drivers/net/wireless/ath5k/reset.c | |||
@@ -537,9 +537,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
537 | mdelay(1); | 537 | mdelay(1); |
538 | 538 | ||
539 | /* | 539 | /* |
540 | * Write some more initial register settings | 540 | * Write some more initial register settings for revised chips |
541 | */ | 541 | */ |
542 | if (ah->ah_version == AR5K_AR5212) { | 542 | if (ah->ah_version == AR5K_AR5212 && |
543 | ah->ah_phy_revision > 0x41) { | ||
543 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); | 544 | ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); |
544 | 545 | ||
545 | if (channel->hw_value == CHANNEL_G) | 546 | if (channel->hw_value == CHANNEL_G) |
@@ -558,19 +559,10 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode, | |||
558 | else | 559 | else |
559 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); | 560 | ath5k_hw_reg_write(ah, 0x00000000, 0x994c); |
560 | 561 | ||
561 | /* Some bits are disabled here, we know nothing about | 562 | /* Got this from legacy-hal */ |
562 | * register 0xa228 yet, most of the times this ends up | 563 | AR5K_REG_DISABLE_BITS(ah, 0xa228, 0x200); |
563 | * with a value 0x9b5 -haven't seen any dump with | 564 | |
564 | * a different value- */ | 565 | AR5K_REG_MASKED_BITS(ah, 0xa228, 0x800, 0xfffe03ff); |
565 | /* Got this from decompiling binary HAL */ | ||
566 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
567 | data &= 0xfffffdff; | ||
568 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
569 | |||
570 | data = ath5k_hw_reg_read(ah, 0xa228); | ||
571 | data &= 0xfffe03ff; | ||
572 | ath5k_hw_reg_write(ah, data, 0xa228); | ||
573 | data = 0; | ||
574 | 566 | ||
575 | /* Just write 0x9b5 ? */ | 567 | /* Just write 0x9b5 ? */ |
576 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ | 568 | /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 24a1aeb6448f..321dbc8c034a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2090,7 +2090,6 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
2090 | iwl4965_error_recovery(priv); | 2090 | iwl4965_error_recovery(priv); |
2091 | 2091 | ||
2092 | iwl_power_update_mode(priv, 1); | 2092 | iwl_power_update_mode(priv, 1); |
2093 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2094 | 2093 | ||
2095 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) | 2094 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) |
2096 | iwl4965_set_mode(priv, priv->iw_mode); | 2095 | iwl4965_set_mode(priv, priv->iw_mode); |
@@ -2342,6 +2341,7 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
2342 | mutex_lock(&priv->mutex); | 2341 | mutex_lock(&priv->mutex); |
2343 | iwl_alive_start(priv); | 2342 | iwl_alive_start(priv); |
2344 | mutex_unlock(&priv->mutex); | 2343 | mutex_unlock(&priv->mutex); |
2344 | ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC); | ||
2345 | } | 2345 | } |
2346 | 2346 | ||
2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) | 2347 | static void iwl4965_bg_rf_kill(struct work_struct *work) |
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 297696de2da0..8265c7d25edc 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -605,9 +605,9 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, | |||
605 | if (ret == 0) { | 605 | if (ret == 0) { |
606 | *curlevel = le16_to_cpu(cmd.curlevel); | 606 | *curlevel = le16_to_cpu(cmd.curlevel); |
607 | if (minlevel) | 607 | if (minlevel) |
608 | *minlevel = le16_to_cpu(cmd.minlevel); | 608 | *minlevel = cmd.minlevel; |
609 | if (maxlevel) | 609 | if (maxlevel) |
610 | *maxlevel = le16_to_cpu(cmd.maxlevel); | 610 | *maxlevel = cmd.maxlevel; |
611 | } | 611 | } |
612 | 612 | ||
613 | lbs_deb_leave(LBS_DEB_CMD); | 613 | lbs_deb_leave(LBS_DEB_CMD); |
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c index 8f66903641b9..22c4c6110521 100644 --- a/drivers/net/wireless/libertas/scan.c +++ b/drivers/net/wireless/libertas/scan.c | |||
@@ -598,8 +598,8 @@ static int lbs_process_bss(struct bss_descriptor *bss, | |||
598 | 598 | ||
599 | switch (elem->id) { | 599 | switch (elem->id) { |
600 | case MFIE_TYPE_SSID: | 600 | case MFIE_TYPE_SSID: |
601 | bss->ssid_len = elem->len; | 601 | bss->ssid_len = min_t(int, 32, elem->len); |
602 | memcpy(bss->ssid, elem->data, elem->len); | 602 | memcpy(bss->ssid, elem->data, bss->ssid_len); |
603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", | 603 | lbs_deb_scan("got SSID IE: '%s', len %u\n", |
604 | escape_essid(bss->ssid, bss->ssid_len), | 604 | escape_essid(bss->ssid, bss->ssid_len), |
605 | bss->ssid_len); | 605 | bss->ssid_len); |
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index f839ce044afd..95511ac22470 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | menuconfig RT2X00 | 1 | menuconfig RT2X00 |
2 | bool "Ralink driver support" | 2 | tristate "Ralink driver support" |
3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL | 3 | depends on MAC80211 && WLAN_80211 && EXPERIMENTAL |
4 | ---help--- | 4 | ---help--- |
5 | This will enable the experimental support for the Ralink drivers, | 5 | This will enable the experimental support for the Ralink drivers, |
diff --git a/drivers/of/device.c b/drivers/of/device.c index 51e5214071da..224ae6bc67b6 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c | |||
@@ -105,7 +105,16 @@ EXPORT_SYMBOL(of_release_dev); | |||
105 | int of_device_register(struct of_device *ofdev) | 105 | int of_device_register(struct of_device *ofdev) |
106 | { | 106 | { |
107 | BUG_ON(ofdev->node == NULL); | 107 | BUG_ON(ofdev->node == NULL); |
108 | return device_register(&ofdev->dev); | 108 | |
109 | device_initialize(&ofdev->dev); | ||
110 | |||
111 | /* device_add will assume that this device is on the same node as | ||
112 | * the parent. If there is no parent defined, set the node | ||
113 | * explicitly */ | ||
114 | if (!ofdev->dev.parent) | ||
115 | set_dev_node(&ofdev->dev, of_node_to_nid(ofdev->node)); | ||
116 | |||
117 | return device_add(&ofdev->dev); | ||
109 | } | 118 | } |
110 | EXPORT_SYMBOL(of_device_register); | 119 | EXPORT_SYMBOL(of_device_register); |
111 | 120 | ||
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index f57eeae3830a..222904411a13 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig | |||
@@ -188,10 +188,6 @@ config PCMCIA_M8XX | |||
188 | 188 | ||
189 | This driver is also available as a module called m8xx_pcmcia. | 189 | This driver is also available as a module called m8xx_pcmcia. |
190 | 190 | ||
191 | config HD64465_PCMCIA | ||
192 | tristate "HD64465 host bridge support" | ||
193 | depends on HD64465 && PCMCIA | ||
194 | |||
195 | config PCMCIA_AU1X00 | 191 | config PCMCIA_AU1X00 |
196 | tristate "Au1x00 pcmcia support" | 192 | tristate "Au1x00 pcmcia support" |
197 | depends on SOC_AU1X00 && PCMCIA | 193 | depends on SOC_AU1X00 && PCMCIA |
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 23e492bf75cf..238629ad7f7c 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -22,7 +22,6 @@ obj-$(CONFIG_I82365) += i82365.o | |||
22 | obj-$(CONFIG_I82092) += i82092.o | 22 | obj-$(CONFIG_I82092) += i82092.o |
23 | obj-$(CONFIG_TCIC) += tcic.o | 23 | obj-$(CONFIG_TCIC) += tcic.o |
24 | obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o | 24 | obj-$(CONFIG_PCMCIA_M8XX) += m8xx_pcmcia.o |
25 | obj-$(CONFIG_HD64465_PCMCIA) += hd64465_ss.o | ||
26 | obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_core.o sa1100_cs.o | 25 | obj-$(CONFIG_PCMCIA_SA1100) += sa11xx_core.o sa1100_cs.o |
27 | obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_core.o sa1111_cs.o | 26 | obj-$(CONFIG_PCMCIA_SA1111) += sa11xx_core.o sa1111_cs.o |
28 | obj-$(CONFIG_M32R_PCC) += m32r_pcc.o | 27 | obj-$(CONFIG_M32R_PCC) += m32r_pcc.o |
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c deleted file mode 100644 index 9ef69cdb3183..000000000000 --- a/drivers/pcmcia/hd64465_ss.c +++ /dev/null | |||
@@ -1,939 +0,0 @@ | |||
1 | /* | ||
2 | * Device driver for the PCMCIA controller module of the | ||
3 | * Hitachi HD64465 handheld companion chip. | ||
4 | * | ||
5 | * Note that the HD64465 provides a very thin PCMCIA host bridge | ||
6 | * layer, requiring a lot of the work of supporting cards to be | ||
7 | * performed by the processor. For example: mapping of card | ||
8 | * interrupts to processor IRQs is done by IRQ demuxing software; | ||
9 | * IO and memory mappings are fixed; setting voltages according | ||
10 | * to card Voltage Select pins etc is done in software. | ||
11 | * | ||
12 | * Note also that this driver uses only the simple, fixed, | ||
13 | * 16MB, 16-bit wide mappings to PCMCIA spaces defined by the | ||
14 | * HD64465. Larger mappings, smaller mappings, or mappings of | ||
15 | * different width to the same socket, are all possible only by | ||
16 | * involving the SH7750's MMU, which is considered unnecessary here. | ||
17 | * The downside is that it may be possible for some drivers to | ||
18 | * break because they need or expect 8-bit mappings. | ||
19 | * | ||
20 | * This driver currently supports only the following configuration: | ||
21 | * SH7750 CPU, HD64465, TPS2206 voltage control chip. | ||
22 | * | ||
23 | * by Greg Banks <gbanks@pocketpenguins.com> | ||
24 | * (c) 2000 PocketPenguins Inc | ||
25 | */ | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #include <linux/module.h> | ||
29 | #include <linux/init.h> | ||
30 | #include <linux/string.h> | ||
31 | #include <linux/kernel.h> | ||
32 | #include <linux/ioport.h> | ||
33 | #include <linux/mm.h> | ||
34 | #include <linux/vmalloc.h> | ||
35 | #include <asm/errno.h> | ||
36 | #include <linux/irq.h> | ||
37 | #include <linux/interrupt.h> | ||
38 | #include <linux/platform_device.h> | ||
39 | |||
40 | #include <asm/io.h> | ||
41 | #include <asm/hd64465/hd64465.h> | ||
42 | #include <asm/hd64465/io.h> | ||
43 | |||
44 | #include <pcmcia/cs_types.h> | ||
45 | #include <pcmcia/cs.h> | ||
46 | #include <pcmcia/cistpl.h> | ||
47 | #include <pcmcia/ds.h> | ||
48 | #include <pcmcia/ss.h> | ||
49 | |||
50 | #define MODNAME "hd64465_ss" | ||
51 | |||
52 | /* #define HD64465_DEBUG 1 */ | ||
53 | |||
54 | #if HD64465_DEBUG | ||
55 | #define DPRINTK(args...) printk(MODNAME ": " args) | ||
56 | #else | ||
57 | #define DPRINTK(args...) | ||
58 | #endif | ||
59 | |||
60 | extern int hd64465_io_debug; | ||
61 | extern void * p3_ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags); | ||
62 | extern void p3_iounmap(void *addr); | ||
63 | |||
64 | /*============================================================*/ | ||
65 | |||
66 | #define HS_IO_MAP_SIZE (64*1024) | ||
67 | |||
68 | typedef struct hs_socket_t | ||
69 | { | ||
70 | unsigned int number; | ||
71 | u_int irq; | ||
72 | u_long mem_base; | ||
73 | void *io_base; | ||
74 | u_long mem_length; | ||
75 | u_int ctrl_base; | ||
76 | socket_state_t state; | ||
77 | pccard_io_map io_maps[MAX_IO_WIN]; | ||
78 | pccard_mem_map mem_maps[MAX_WIN]; | ||
79 | struct pcmcia_socket socket; | ||
80 | } hs_socket_t; | ||
81 | |||
82 | |||
83 | |||
84 | #define HS_MAX_SOCKETS 2 | ||
85 | static hs_socket_t hs_sockets[HS_MAX_SOCKETS]; | ||
86 | |||
87 | #define hs_in(sp, r) inb((sp)->ctrl_base + (r)) | ||
88 | #define hs_out(sp, v, r) outb(v, (sp)->ctrl_base + (r)) | ||
89 | |||
90 | |||
91 | /* translate a boolean value to a bit in a register */ | ||
92 | #define bool_to_regbit(sp, r, bi, bo) \ | ||
93 | do { \ | ||
94 | unsigned short v = hs_in(sp, r); \ | ||
95 | if (bo) \ | ||
96 | v |= (bi); \ | ||
97 | else \ | ||
98 | v &= ~(bi); \ | ||
99 | hs_out(sp, v, r); \ | ||
100 | } while(0) | ||
101 | |||
102 | /* register offsets from HD64465_REG_PCC[01]ISR */ | ||
103 | #define ISR 0x0 | ||
104 | #define GCR 0x2 | ||
105 | #define CSCR 0x4 | ||
106 | #define CSCIER 0x6 | ||
107 | #define SCR 0x8 | ||
108 | |||
109 | |||
110 | /* Mask and values for CSCIER register */ | ||
111 | #define IER_MASK 0x80 | ||
112 | #define IER_ON 0x3f /* interrupts on */ | ||
113 | #define IER_OFF 0x00 /* interrupts off */ | ||
114 | |||
115 | /*============================================================*/ | ||
116 | |||
117 | #if HD64465_DEBUG > 10 | ||
118 | |||
119 | static void cis_hex_dump(const unsigned char *x, int len) | ||
120 | { | ||
121 | int i; | ||
122 | |||
123 | for (i=0 ; i<len ; i++) | ||
124 | { | ||
125 | if (!(i & 0xf)) | ||
126 | printk("\n%08x", (unsigned)(x + i)); | ||
127 | printk(" %02x", *(volatile unsigned short*)x); | ||
128 | x += 2; | ||
129 | } | ||
130 | printk("\n"); | ||
131 | } | ||
132 | |||
133 | #endif | ||
134 | /*============================================================*/ | ||
135 | |||
136 | /* | ||
137 | * This code helps create the illusion that the IREQ line from | ||
138 | * the PC card is mapped to one of the CPU's IRQ lines by the | ||
139 | * host bridge hardware (which is how every host bridge *except* | ||
140 | * the HD64465 works). In particular, it supports enabling | ||
141 | * and disabling the IREQ line by code which knows nothing | ||
142 | * about the host bridge (e.g. device drivers, IDE code) using | ||
143 | * the request_irq(), free_irq(), probe_irq_on() and probe_irq_off() | ||
144 | * functions. Also, it supports sharing the mapped IRQ with | ||
145 | * real hardware IRQs from the -IRL0-3 lines. | ||
146 | */ | ||
147 | |||
148 | #define HS_NUM_MAPPED_IRQS 16 /* Limitation of the PCMCIA code */ | ||
149 | static struct | ||
150 | { | ||
151 | /* index is mapped irq number */ | ||
152 | hs_socket_t *sock; | ||
153 | hw_irq_controller *old_handler; | ||
154 | } hs_mapped_irq[HS_NUM_MAPPED_IRQS]; | ||
155 | |||
156 | static void hs_socket_enable_ireq(hs_socket_t *sp) | ||
157 | { | ||
158 | unsigned short cscier; | ||
159 | |||
160 | DPRINTK("hs_socket_enable_ireq(sock=%d)\n", sp->number); | ||
161 | |||
162 | cscier = hs_in(sp, CSCIER); | ||
163 | cscier &= ~HD64465_PCCCSCIER_PIREQE_MASK; | ||
164 | cscier |= HD64465_PCCCSCIER_PIREQE_LEVEL; | ||
165 | hs_out(sp, cscier, CSCIER); | ||
166 | } | ||
167 | |||
168 | static void hs_socket_disable_ireq(hs_socket_t *sp) | ||
169 | { | ||
170 | unsigned short cscier; | ||
171 | |||
172 | DPRINTK("hs_socket_disable_ireq(sock=%d)\n", sp->number); | ||
173 | |||
174 | cscier = hs_in(sp, CSCIER); | ||
175 | cscier &= ~HD64465_PCCCSCIER_PIREQE_MASK; | ||
176 | hs_out(sp, cscier, CSCIER); | ||
177 | } | ||
178 | |||
179 | static unsigned int hs_startup_irq(unsigned int irq) | ||
180 | { | ||
181 | hs_socket_enable_ireq(hs_mapped_irq[irq].sock); | ||
182 | hs_mapped_irq[irq].old_handler->startup(irq); | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | static void hs_shutdown_irq(unsigned int irq) | ||
187 | { | ||
188 | hs_socket_disable_ireq(hs_mapped_irq[irq].sock); | ||
189 | hs_mapped_irq[irq].old_handler->shutdown(irq); | ||
190 | } | ||
191 | |||
192 | static void hs_enable_irq(unsigned int irq) | ||
193 | { | ||
194 | hs_socket_enable_ireq(hs_mapped_irq[irq].sock); | ||
195 | hs_mapped_irq[irq].old_handler->enable(irq); | ||
196 | } | ||
197 | |||
198 | static void hs_disable_irq(unsigned int irq) | ||
199 | { | ||
200 | hs_socket_disable_ireq(hs_mapped_irq[irq].sock); | ||
201 | hs_mapped_irq[irq].old_handler->disable(irq); | ||
202 | } | ||
203 | |||
204 | extern struct hw_interrupt_type no_irq_type; | ||
205 | |||
206 | static void hs_mask_and_ack_irq(unsigned int irq) | ||
207 | { | ||
208 | hs_socket_disable_ireq(hs_mapped_irq[irq].sock); | ||
209 | /* ack_none() spuriously complains about an unexpected IRQ */ | ||
210 | if (hs_mapped_irq[irq].old_handler != &no_irq_type) | ||
211 | hs_mapped_irq[irq].old_handler->ack(irq); | ||
212 | } | ||
213 | |||
214 | static void hs_end_irq(unsigned int irq) | ||
215 | { | ||
216 | hs_socket_enable_ireq(hs_mapped_irq[irq].sock); | ||
217 | hs_mapped_irq[irq].old_handler->end(irq); | ||
218 | } | ||
219 | |||
220 | |||
221 | static struct hw_interrupt_type hd64465_ss_irq_type = { | ||
222 | .typename = "PCMCIA-IRQ", | ||
223 | .startup = hs_startup_irq, | ||
224 | .shutdown = hs_shutdown_irq, | ||
225 | .enable = hs_enable_irq, | ||
226 | .disable = hs_disable_irq, | ||
227 | .ack = hs_mask_and_ack_irq, | ||
228 | .end = hs_end_irq | ||
229 | }; | ||
230 | |||
231 | /* | ||
232 | * This function should only ever be called with interrupts disabled. | ||
233 | */ | ||
234 | static void hs_map_irq(hs_socket_t *sp, unsigned int irq) | ||
235 | { | ||
236 | struct irq_desc *desc; | ||
237 | |||
238 | DPRINTK("hs_map_irq(sock=%d irq=%d)\n", sp->number, irq); | ||
239 | |||
240 | if (irq >= HS_NUM_MAPPED_IRQS) | ||
241 | return; | ||
242 | |||
243 | desc = irq_to_desc(irq); | ||
244 | hs_mapped_irq[irq].sock = sp; | ||
245 | /* insert ourselves as the irq controller */ | ||
246 | hs_mapped_irq[irq].old_handler = desc->chip; | ||
247 | desc->chip = &hd64465_ss_irq_type; | ||
248 | } | ||
249 | |||
250 | |||
251 | /* | ||
252 | * This function should only ever be called with interrupts disabled. | ||
253 | */ | ||
254 | static void hs_unmap_irq(hs_socket_t *sp, unsigned int irq) | ||
255 | { | ||
256 | struct irq_desc *desc; | ||
257 | |||
258 | DPRINTK("hs_unmap_irq(sock=%d irq=%d)\n", sp->number, irq); | ||
259 | |||
260 | if (irq >= HS_NUM_MAPPED_IRQS) | ||
261 | return; | ||
262 | |||
263 | desc = irq_to_desc(irq); | ||
264 | /* restore the original irq controller */ | ||
265 | desc->chip = hs_mapped_irq[irq].old_handler; | ||
266 | } | ||
267 | |||
268 | /*============================================================*/ | ||
269 | |||
270 | |||
271 | /* | ||
272 | * Set Vpp and Vcc (in tenths of a Volt). Does not | ||
273 | * support the hi-Z state. | ||
274 | * | ||
275 | * Note, this assumes the board uses a TPS2206 chip to control | ||
276 | * the Vcc and Vpp voltages to the hs_sockets. If your board | ||
277 | * uses the MIC2563 (also supported by the HD64465) then you | ||
278 | * will have to modify this function. | ||
279 | */ | ||
280 | /* 0V 3.3V 5.5V */ | ||
281 | static const u_char hs_tps2206_avcc[3] = { 0x00, 0x04, 0x08 }; | ||
282 | static const u_char hs_tps2206_bvcc[3] = { 0x00, 0x80, 0x40 }; | ||
283 | |||
284 | static int hs_set_voltages(hs_socket_t *sp, int Vcc, int Vpp) | ||
285 | { | ||
286 | u_int psr; | ||
287 | u_int vcci = 0; | ||
288 | u_int sock = sp->number; | ||
289 | |||
290 | DPRINTK("hs_set_voltage(%d, %d, %d)\n", sock, Vcc, Vpp); | ||
291 | |||
292 | switch (Vcc) | ||
293 | { | ||
294 | case 0: vcci = 0; break; | ||
295 | case 33: vcci = 1; break; | ||
296 | case 50: vcci = 2; break; | ||
297 | default: return 0; | ||
298 | } | ||
299 | |||
300 | /* Note: Vpp = 120 not supported -- Greg Banks */ | ||
301 | if (Vpp != 0 && Vpp != Vcc) | ||
302 | return 0; | ||
303 | |||
304 | /* The PSR register holds 8 of the 9 bits which control | ||
305 | * the TPS2206 via its serial interface. | ||
306 | */ | ||
307 | psr = inw(HD64465_REG_PCCPSR); | ||
308 | switch (sock) | ||
309 | { | ||
310 | case 0: | ||
311 | psr &= 0x0f; | ||
312 | psr |= hs_tps2206_avcc[vcci]; | ||
313 | psr |= (Vpp == 0 ? 0x00 : 0x02); | ||
314 | break; | ||
315 | case 1: | ||
316 | psr &= 0xf0; | ||
317 | psr |= hs_tps2206_bvcc[vcci]; | ||
318 | psr |= (Vpp == 0 ? 0x00 : 0x20); | ||
319 | break; | ||
320 | }; | ||
321 | outw(psr, HD64465_REG_PCCPSR); | ||
322 | |||
323 | return 1; | ||
324 | } | ||
325 | |||
326 | |||
327 | /*============================================================*/ | ||
328 | |||
329 | /* | ||
330 | * Drive the RESET line to the card. | ||
331 | */ | ||
332 | static void hs_reset_socket(hs_socket_t *sp, int on) | ||
333 | { | ||
334 | unsigned short v; | ||
335 | |||
336 | v = hs_in(sp, GCR); | ||
337 | if (on) | ||
338 | v |= HD64465_PCCGCR_PCCR; | ||
339 | else | ||
340 | v &= ~HD64465_PCCGCR_PCCR; | ||
341 | hs_out(sp, v, GCR); | ||
342 | } | ||
343 | |||
344 | /*============================================================*/ | ||
345 | |||
346 | static int hs_init(struct pcmcia_socket *s) | ||
347 | { | ||
348 | hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); | ||
349 | |||
350 | DPRINTK("hs_init(%d)\n", sp->number); | ||
351 | |||
352 | return 0; | ||
353 | } | ||
354 | |||
355 | /*============================================================*/ | ||
356 | |||
357 | |||
358 | static int hs_get_status(struct pcmcia_socket *s, u_int *value) | ||
359 | { | ||
360 | hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); | ||
361 | unsigned int isr; | ||
362 | u_int status = 0; | ||
363 | |||
364 | |||
365 | isr = hs_in(sp, ISR); | ||
366 | |||
367 | /* Card is seated and powered when *both* CD pins are low */ | ||
368 | if ((isr & HD64465_PCCISR_PCD_MASK) == 0) | ||
369 | { | ||
370 | status |= SS_DETECT; /* card present */ | ||
371 | |||
372 | switch (isr & HD64465_PCCISR_PBVD_MASK) | ||
373 | { | ||
374 | case HD64465_PCCISR_PBVD_BATGOOD: | ||
375 | break; | ||
376 | case HD64465_PCCISR_PBVD_BATWARN: | ||
377 | status |= SS_BATWARN; | ||
378 | break; | ||
379 | default: | ||
380 | status |= SS_BATDEAD; | ||
381 | break; | ||
382 | } | ||
383 | |||
384 | if (isr & HD64465_PCCISR_PREADY) | ||
385 | status |= SS_READY; | ||
386 | |||
387 | if (isr & HD64465_PCCISR_PMWP) | ||
388 | status |= SS_WRPROT; | ||
389 | |||
390 | /* Voltage Select pins interpreted as per Table 4-5 of the std. | ||
391 | * Assuming we have the TPS2206, the socket is a "Low Voltage | ||
392 | * key, 3.3V and 5V available, no X.XV available". | ||
393 | */ | ||
394 | switch (isr & (HD64465_PCCISR_PVS2|HD64465_PCCISR_PVS1)) | ||
395 | { | ||
396 | case HD64465_PCCISR_PVS1: | ||
397 | printk(KERN_NOTICE MODNAME ": cannot handle X.XV card, ignored\n"); | ||
398 | status = 0; | ||
399 | break; | ||
400 | case 0: | ||
401 | case HD64465_PCCISR_PVS2: | ||
402 | /* 3.3V */ | ||
403 | status |= SS_3VCARD; | ||
404 | break; | ||
405 | case HD64465_PCCISR_PVS2|HD64465_PCCISR_PVS1: | ||
406 | /* 5V */ | ||
407 | break; | ||
408 | } | ||
409 | |||
410 | /* TODO: SS_POWERON */ | ||
411 | /* TODO: SS_STSCHG */ | ||
412 | } | ||
413 | |||
414 | DPRINTK("hs_get_status(%d) = %x\n", sock, status); | ||
415 | |||
416 | *value = status; | ||
417 | return 0; | ||
418 | } | ||
419 | |||
420 | /*============================================================*/ | ||
421 | |||
422 | static int hs_set_socket(struct pcmcia_socket *s, socket_state_t *state) | ||
423 | { | ||
424 | hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); | ||
425 | u_long flags; | ||
426 | u_int changed; | ||
427 | unsigned short cscier; | ||
428 | |||
429 | DPRINTK("hs_set_socket(sock=%d, flags=%x, csc_mask=%x, Vcc=%d, Vpp=%d, io_irq=%d)\n", | ||
430 | sock, state->flags, state->csc_mask, state->Vcc, state->Vpp, state->io_irq); | ||
431 | |||
432 | local_irq_save(flags); /* Don't want interrupts happening here */ | ||
433 | |||
434 | if (state->Vpp != sp->state.Vpp || | ||
435 | state->Vcc != sp->state.Vcc) { | ||
436 | if (!hs_set_voltages(sp, state->Vcc, state->Vpp)) { | ||
437 | local_irq_restore(flags); | ||
438 | return -EINVAL; | ||
439 | } | ||
440 | } | ||
441 | |||
442 | /* hd64465_io_debug = 1; */ | ||
443 | /* | ||
444 | * Handle changes in the Card Status Change mask, | ||
445 | * by propagating to the CSCR register | ||
446 | */ | ||
447 | changed = sp->state.csc_mask ^ state->csc_mask; | ||
448 | cscier = hs_in(sp, CSCIER); | ||
449 | |||
450 | if (changed & SS_DETECT) { | ||
451 | if (state->csc_mask & SS_DETECT) | ||
452 | cscier |= HD64465_PCCCSCIER_PCDE; | ||
453 | else | ||
454 | cscier &= ~HD64465_PCCCSCIER_PCDE; | ||
455 | } | ||
456 | |||
457 | if (changed & SS_READY) { | ||
458 | if (state->csc_mask & SS_READY) | ||
459 | cscier |= HD64465_PCCCSCIER_PRE; | ||
460 | else | ||
461 | cscier &= ~HD64465_PCCCSCIER_PRE; | ||
462 | } | ||
463 | |||
464 | if (changed & SS_BATDEAD) { | ||
465 | if (state->csc_mask & SS_BATDEAD) | ||
466 | cscier |= HD64465_PCCCSCIER_PBDE; | ||
467 | else | ||
468 | cscier &= ~HD64465_PCCCSCIER_PBDE; | ||
469 | } | ||
470 | |||
471 | if (changed & SS_BATWARN) { | ||
472 | if (state->csc_mask & SS_BATWARN) | ||
473 | cscier |= HD64465_PCCCSCIER_PBWE; | ||
474 | else | ||
475 | cscier &= ~HD64465_PCCCSCIER_PBWE; | ||
476 | } | ||
477 | |||
478 | if (changed & SS_STSCHG) { | ||
479 | if (state->csc_mask & SS_STSCHG) | ||
480 | cscier |= HD64465_PCCCSCIER_PSCE; | ||
481 | else | ||
482 | cscier &= ~HD64465_PCCCSCIER_PSCE; | ||
483 | } | ||
484 | |||
485 | hs_out(sp, cscier, CSCIER); | ||
486 | |||
487 | if (sp->state.io_irq && !state->io_irq) | ||
488 | hs_unmap_irq(sp, sp->state.io_irq); | ||
489 | else if (!sp->state.io_irq && state->io_irq) | ||
490 | hs_map_irq(sp, state->io_irq); | ||
491 | |||
492 | |||
493 | /* | ||
494 | * Handle changes in the flags field, | ||
495 | * by propagating to config registers. | ||
496 | */ | ||
497 | changed = sp->state.flags ^ state->flags; | ||
498 | |||
499 | if (changed & SS_IOCARD) { | ||
500 | DPRINTK("card type: %s\n", | ||
501 | (state->flags & SS_IOCARD ? "i/o" : "memory" )); | ||
502 | bool_to_regbit(sp, GCR, HD64465_PCCGCR_PCCT, | ||
503 | state->flags & SS_IOCARD); | ||
504 | } | ||
505 | |||
506 | if (changed & SS_RESET) { | ||
507 | DPRINTK("%s reset card\n", | ||
508 | (state->flags & SS_RESET ? "start" : "stop")); | ||
509 | bool_to_regbit(sp, GCR, HD64465_PCCGCR_PCCR, | ||
510 | state->flags & SS_RESET); | ||
511 | } | ||
512 | |||
513 | if (changed & SS_OUTPUT_ENA) { | ||
514 | DPRINTK("%sabling card output\n", | ||
515 | (state->flags & SS_OUTPUT_ENA ? "en" : "dis")); | ||
516 | bool_to_regbit(sp, GCR, HD64465_PCCGCR_PDRV, | ||
517 | state->flags & SS_OUTPUT_ENA); | ||
518 | } | ||
519 | |||
520 | /* TODO: SS_SPKR_ENA */ | ||
521 | |||
522 | /* hd64465_io_debug = 0; */ | ||
523 | sp->state = *state; | ||
524 | |||
525 | local_irq_restore(flags); | ||
526 | |||
527 | #if HD64465_DEBUG > 10 | ||
528 | if (state->flags & SS_OUTPUT_ENA) | ||
529 | cis_hex_dump((const unsigned char*)sp->mem_base, 0x100); | ||
530 | #endif | ||
531 | return 0; | ||
532 | } | ||
533 | |||
534 | /*============================================================*/ | ||
535 | |||
536 | static int hs_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io) | ||
537 | { | ||
538 | hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); | ||
539 | int map = io->map; | ||
540 | int sock = sp->number; | ||
541 | struct pccard_io_map *sio; | ||
542 | pgprot_t prot; | ||
543 | |||
544 | DPRINTK("hs_set_io_map(sock=%d, map=%d, flags=0x%x, speed=%dns, start=%#lx, stop=%#lx)\n", | ||
545 | sock, map, io->flags, io->speed, io->start, io->stop); | ||
546 | if (map >= MAX_IO_WIN) | ||
547 | return -EINVAL; | ||
548 | sio = &sp->io_maps[map]; | ||
549 | |||
550 | /* check for null changes */ | ||
551 | if (io->flags == sio->flags && | ||
552 | io->start == sio->start && | ||
553 | io->stop == sio->stop) | ||
554 | return 0; | ||
555 | |||
556 | if (io->flags & MAP_AUTOSZ) | ||
557 | prot = PAGE_KERNEL_PCC(sock, _PAGE_PCC_IODYN); | ||
558 | else if (io->flags & MAP_16BIT) | ||
559 | prot = PAGE_KERNEL_PCC(sock, _PAGE_PCC_IO16); | ||
560 | else | ||
561 | prot = PAGE_KERNEL_PCC(sock, _PAGE_PCC_IO8); | ||
562 | |||
563 | /* TODO: handle MAP_USE_WAIT */ | ||
564 | if (io->flags & MAP_USE_WAIT) | ||
565 | printk(KERN_INFO MODNAME ": MAP_USE_WAIT unimplemented\n"); | ||
566 | /* TODO: handle MAP_PREFETCH */ | ||
567 | if (io->flags & MAP_PREFETCH) | ||
568 | printk(KERN_INFO MODNAME ": MAP_PREFETCH unimplemented\n"); | ||
569 | /* TODO: handle MAP_WRPROT */ | ||
570 | if (io->flags & MAP_WRPROT) | ||
571 | printk(KERN_INFO MODNAME ": MAP_WRPROT unimplemented\n"); | ||
572 | /* TODO: handle MAP_0WS */ | ||
573 | if (io->flags & MAP_0WS) | ||
574 | printk(KERN_INFO MODNAME ": MAP_0WS unimplemented\n"); | ||
575 | |||
576 | if (io->flags & MAP_ACTIVE) { | ||
577 | unsigned long pstart, psize, paddrbase; | ||
578 | |||
579 | paddrbase = virt_to_phys((void*)(sp->mem_base + 2 * HD64465_PCC_WINDOW)); | ||
580 | pstart = io->start & PAGE_MASK; | ||
581 | psize = ((io->stop + PAGE_SIZE) & PAGE_MASK) - pstart; | ||
582 | |||
583 | /* | ||
584 | * Change PTEs in only that portion of the mapping requested | ||
585 | * by the caller. This means that most of the time, most of | ||
586 | * the PTEs in the io_vma will be unmapped and only the bottom | ||
587 | * page will be mapped. But the code allows for weird cards | ||
588 | * that might want IO ports > 4K. | ||
589 | */ | ||
590 | sp->io_base = p3_ioremap(paddrbase + pstart, psize, pgprot_val(prot)); | ||
591 | |||
592 | /* | ||
593 | * Change the mapping used by inb() outb() etc | ||
594 | */ | ||
595 | hd64465_port_map(io->start, | ||
596 | io->stop - io->start + 1, | ||
597 | (unsigned long)sp->io_base + io->start, 0); | ||
598 | } else { | ||
599 | hd64465_port_unmap(sio->start, sio->stop - sio->start + 1); | ||
600 | p3_iounmap(sp->io_base); | ||
601 | } | ||
602 | |||
603 | *sio = *io; | ||
604 | return 0; | ||
605 | } | ||
606 | |||
607 | /*============================================================*/ | ||
608 | |||
609 | static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) | ||
610 | { | ||
611 | hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); | ||
612 | struct pccard_mem_map *smem; | ||
613 | int map = mem->map; | ||
614 | unsigned long paddr; | ||
615 | |||
616 | #if 0 | ||
617 | DPRINTK("hs_set_mem_map(sock=%d, map=%d, flags=0x%x, card_start=0x%08x)\n", | ||
618 | sock, map, mem->flags, mem->card_start); | ||
619 | #endif | ||
620 | |||
621 | if (map >= MAX_WIN) | ||
622 | return -EINVAL; | ||
623 | smem = &sp->mem_maps[map]; | ||
624 | |||
625 | paddr = sp->mem_base; /* base of Attribute mapping */ | ||
626 | if (!(mem->flags & MAP_ATTRIB)) | ||
627 | paddr += HD64465_PCC_WINDOW; /* base of Common mapping */ | ||
628 | paddr += mem->card_start; | ||
629 | |||
630 | /* Because we specified SS_CAP_STATIC_MAP, we are obliged | ||
631 | * at this time to report the system address corresponding | ||
632 | * to the card address requested. This is how Socket Services | ||
633 | * queries our fixed mapping. I wish this fact had been | ||
634 | * documented - Greg Banks. | ||
635 | */ | ||
636 | mem->static_start = paddr; | ||
637 | |||
638 | *smem = *mem; | ||
639 | |||
640 | return 0; | ||
641 | } | ||
642 | |||
643 | /* TODO: do we need to use the MMU to access Common memory ??? */ | ||
644 | |||
645 | /*============================================================*/ | ||
646 | |||
647 | /* | ||
648 | * This function is registered with the HD64465 glue code to do a | ||
649 | * secondary demux step on the PCMCIA interrupts. It handles | ||
650 | * mapping the IREQ request from the card to a standard Linux | ||
651 | * IRQ, as requested by SocketServices. | ||
652 | */ | ||
653 | static int hs_irq_demux(int irq, void *dev) | ||
654 | { | ||
655 | hs_socket_t *sp = dev; | ||
656 | u_int cscr; | ||
657 | |||
658 | DPRINTK("hs_irq_demux(irq=%d)\n", irq); | ||
659 | |||
660 | if (sp->state.io_irq && | ||
661 | (cscr = hs_in(sp, CSCR)) & HD64465_PCCCSCR_PIREQ) { | ||
662 | cscr &= ~HD64465_PCCCSCR_PIREQ; | ||
663 | hs_out(sp, cscr, CSCR); | ||
664 | return sp->state.io_irq; | ||
665 | } | ||
666 | |||
667 | return irq; | ||
668 | } | ||
669 | |||
670 | /*============================================================*/ | ||
671 | |||
672 | /* | ||
673 | * Interrupt handling routine. | ||
674 | */ | ||
675 | |||
676 | static irqreturn_t hs_interrupt(int irq, void *dev) | ||
677 | { | ||
678 | hs_socket_t *sp = dev; | ||
679 | u_int events = 0; | ||
680 | u_int cscr; | ||
681 | |||
682 | cscr = hs_in(sp, CSCR); | ||
683 | |||
684 | DPRINTK("hs_interrupt, cscr=%04x\n", cscr); | ||
685 | |||
686 | /* check for bus-related changes to be reported to Socket Services */ | ||
687 | if (cscr & HD64465_PCCCSCR_PCDC) { | ||
688 | /* double-check for a 16-bit card, as we don't support CardBus */ | ||
689 | if ((hs_in(sp, ISR) & HD64465_PCCISR_PCD_MASK) != 0) { | ||
690 | printk(KERN_NOTICE MODNAME | ||
691 | ": socket %d, card not a supported card type or not inserted correctly\n", | ||
692 | sp->number); | ||
693 | /* Don't do the rest unless a card is present */ | ||
694 | cscr &= ~(HD64465_PCCCSCR_PCDC| | ||
695 | HD64465_PCCCSCR_PRC| | ||
696 | HD64465_PCCCSCR_PBW| | ||
697 | HD64465_PCCCSCR_PBD| | ||
698 | HD64465_PCCCSCR_PSC); | ||
699 | } else { | ||
700 | cscr &= ~HD64465_PCCCSCR_PCDC; | ||
701 | events |= SS_DETECT; /* card insertion or removal */ | ||
702 | } | ||
703 | } | ||
704 | if (cscr & HD64465_PCCCSCR_PRC) { | ||
705 | cscr &= ~HD64465_PCCCSCR_PRC; | ||
706 | events |= SS_READY; /* ready signal changed */ | ||
707 | } | ||
708 | if (cscr & HD64465_PCCCSCR_PBW) { | ||
709 | cscr &= ~HD64465_PCCCSCR_PSC; | ||
710 | events |= SS_BATWARN; /* battery warning */ | ||
711 | } | ||
712 | if (cscr & HD64465_PCCCSCR_PBD) { | ||
713 | cscr &= ~HD64465_PCCCSCR_PSC; | ||
714 | events |= SS_BATDEAD; /* battery dead */ | ||
715 | } | ||
716 | if (cscr & HD64465_PCCCSCR_PSC) { | ||
717 | cscr &= ~HD64465_PCCCSCR_PSC; | ||
718 | events |= SS_STSCHG; /* STSCHG (status changed) signal */ | ||
719 | } | ||
720 | |||
721 | if (cscr & HD64465_PCCCSCR_PIREQ) { | ||
722 | cscr &= ~HD64465_PCCCSCR_PIREQ; | ||
723 | |||
724 | /* This should have been dealt with during irq demux */ | ||
725 | printk(KERN_NOTICE MODNAME ": unexpected IREQ from card\n"); | ||
726 | } | ||
727 | |||
728 | hs_out(sp, cscr, CSCR); | ||
729 | |||
730 | if (events) | ||
731 | pcmcia_parse_events(&sp->socket, events); | ||
732 | |||
733 | return IRQ_HANDLED; | ||
734 | } | ||
735 | |||
736 | /*============================================================*/ | ||
737 | |||
738 | static struct pccard_operations hs_operations = { | ||
739 | .init = hs_init, | ||
740 | .get_status = hs_get_status, | ||
741 | .set_socket = hs_set_socket, | ||
742 | .set_io_map = hs_set_io_map, | ||
743 | .set_mem_map = hs_set_mem_map, | ||
744 | }; | ||
745 | |||
746 | static int hs_init_socket(hs_socket_t *sp, int irq, unsigned long mem_base, | ||
747 | unsigned int ctrl_base) | ||
748 | { | ||
749 | unsigned short v; | ||
750 | int i, err; | ||
751 | |||
752 | memset(sp, 0, sizeof(*sp)); | ||
753 | sp->irq = irq; | ||
754 | sp->mem_base = mem_base; | ||
755 | sp->mem_length = 4*HD64465_PCC_WINDOW; /* 16MB */ | ||
756 | sp->ctrl_base = ctrl_base; | ||
757 | |||
758 | for (i=0 ; i<MAX_IO_WIN ; i++) | ||
759 | sp->io_maps[i].map = i; | ||
760 | for (i=0 ; i<MAX_WIN ; i++) | ||
761 | sp->mem_maps[i].map = i; | ||
762 | |||
763 | hd64465_register_irq_demux(sp->irq, hs_irq_demux, sp); | ||
764 | |||
765 | if ((err = request_irq(sp->irq, hs_interrupt, IRQF_DISABLED, MODNAME, sp)) < 0) | ||
766 | return err; | ||
767 | if (request_mem_region(sp->mem_base, sp->mem_length, MODNAME) == 0) { | ||
768 | sp->mem_base = 0; | ||
769 | return -ENOMEM; | ||
770 | } | ||
771 | |||
772 | |||
773 | /* According to section 3.2 of the PCMCIA standard, low-voltage | ||
774 | * capable cards must implement cold insertion, i.e. Vpp and | ||
775 | * Vcc set to 0 before card is inserted. | ||
776 | */ | ||
777 | /*hs_set_voltages(sp, 0, 0);*/ | ||
778 | |||
779 | /* hi-Z the outputs to the card and set 16MB map mode */ | ||
780 | v = hs_in(sp, GCR); | ||
781 | v &= ~HD64465_PCCGCR_PCCT; /* memory-only card */ | ||
782 | hs_out(sp, v, GCR); | ||
783 | |||
784 | v = hs_in(sp, GCR); | ||
785 | v |= HD64465_PCCGCR_PDRV; /* enable outputs to card */ | ||
786 | hs_out(sp, v, GCR); | ||
787 | |||
788 | v = hs_in(sp, GCR); | ||
789 | v |= HD64465_PCCGCR_PMMOD; /* 16MB mapping mode */ | ||
790 | hs_out(sp, v, GCR); | ||
791 | |||
792 | v = hs_in(sp, GCR); | ||
793 | /* lowest 16MB of Common */ | ||
794 | v &= ~(HD64465_PCCGCR_PPA25|HD64465_PCCGCR_PPA24); | ||
795 | hs_out(sp, v, GCR); | ||
796 | |||
797 | hs_reset_socket(sp, 1); | ||
798 | |||
799 | printk(KERN_INFO "HD64465 PCMCIA bridge socket %d at 0x%08lx irq %d\n", | ||
800 | i, sp->mem_base, sp->irq); | ||
801 | |||
802 | return 0; | ||
803 | } | ||
804 | |||
805 | static void hs_exit_socket(hs_socket_t *sp) | ||
806 | { | ||
807 | unsigned short cscier, gcr; | ||
808 | unsigned long flags; | ||
809 | |||
810 | local_irq_save(flags); | ||
811 | |||
812 | /* turn off interrupts in hardware */ | ||
813 | cscier = hs_in(sp, CSCIER); | ||
814 | cscier = (cscier & IER_MASK) | IER_OFF; | ||
815 | hs_out(sp, cscier, CSCIER); | ||
816 | |||
817 | /* hi-Z the outputs to the card */ | ||
818 | gcr = hs_in(sp, GCR); | ||
819 | gcr &= HD64465_PCCGCR_PDRV; | ||
820 | hs_out(sp, gcr, GCR); | ||
821 | |||
822 | /* power the card down */ | ||
823 | hs_set_voltages(sp, 0, 0); | ||
824 | |||
825 | if (sp->mem_base != 0) | ||
826 | release_mem_region(sp->mem_base, sp->mem_length); | ||
827 | if (sp->irq != 0) { | ||
828 | free_irq(sp->irq, hs_interrupt); | ||
829 | hd64465_unregister_irq_demux(sp->irq); | ||
830 | } | ||
831 | |||
832 | local_irq_restore(flags); | ||
833 | } | ||
834 | |||
835 | static struct device_driver hd64465_driver = { | ||
836 | .name = "hd64465-pcmcia", | ||
837 | .bus = &platform_bus_type, | ||
838 | .suspend = pcmcia_socket_dev_suspend, | ||
839 | .resume = pcmcia_socket_dev_resume, | ||
840 | }; | ||
841 | |||
842 | static struct platform_device hd64465_device = { | ||
843 | .name = "hd64465-pcmcia", | ||
844 | .id = 0, | ||
845 | }; | ||
846 | |||
847 | static int __init init_hs(void) | ||
848 | { | ||
849 | int i; | ||
850 | unsigned short v; | ||
851 | |||
852 | /* hd64465_io_debug = 1; */ | ||
853 | if (driver_register(&hd64465_driver)) | ||
854 | return -EINVAL; | ||
855 | |||
856 | /* Wake both sockets out of STANDBY mode */ | ||
857 | /* TODO: wait 15ms */ | ||
858 | v = inw(HD64465_REG_SMSCR); | ||
859 | v &= ~(HD64465_SMSCR_PC0ST|HD64465_SMSCR_PC1ST); | ||
860 | outw(v, HD64465_REG_SMSCR); | ||
861 | |||
862 | /* keep power controller out of shutdown mode */ | ||
863 | v = inb(HD64465_REG_PCC0SCR); | ||
864 | v |= HD64465_PCCSCR_SHDN; | ||
865 | outb(v, HD64465_REG_PCC0SCR); | ||
866 | |||
867 | /* use serial (TPS2206) power controller */ | ||
868 | v = inb(HD64465_REG_PCC0CSCR); | ||
869 | v |= HD64465_PCCCSCR_PSWSEL; | ||
870 | outb(v, HD64465_REG_PCC0CSCR); | ||
871 | |||
872 | /* | ||
873 | * Setup hs_sockets[] structures and request system resources. | ||
874 | * TODO: on memory allocation failure, power down the socket | ||
875 | * before quitting. | ||
876 | */ | ||
877 | for (i=0; i<HS_MAX_SOCKETS; i++) { | ||
878 | hs_set_voltages(&hs_sockets[i], 0, 0); | ||
879 | |||
880 | hs_sockets[i].socket.features |= SS_CAP_PCCARD | SS_CAP_STATIC_MAP; /* mappings are fixed in host memory */ | ||
881 | hs_sockets[i].socket.resource_ops = &pccard_static_ops; | ||
882 | hs_sockets[i].socket.irq_mask = 0xffde;/*0xffff*/ /* IRQs mapped in s/w so can do any, really */ | ||
883 | hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW; /* 16MB fixed window size */ | ||
884 | |||
885 | hs_sockets[i].socket.owner = THIS_MODULE; | ||
886 | hs_sockets[i].socket.ss_entry = &hs_operations; | ||
887 | } | ||
888 | |||
889 | i = hs_init_socket(&hs_sockets[0], | ||
890 | HD64465_IRQ_PCMCIA0, | ||
891 | HD64465_PCC0_BASE, | ||
892 | HD64465_REG_PCC0ISR); | ||
893 | if (i < 0) { | ||
894 | unregister_driver(&hd64465_driver); | ||
895 | return i; | ||
896 | } | ||
897 | i = hs_init_socket(&hs_sockets[1], | ||
898 | HD64465_IRQ_PCMCIA1, | ||
899 | HD64465_PCC1_BASE, | ||
900 | HD64465_REG_PCC1ISR); | ||
901 | if (i < 0) { | ||
902 | unregister_driver(&hd64465_driver); | ||
903 | return i; | ||
904 | } | ||
905 | |||
906 | /* hd64465_io_debug = 0; */ | ||
907 | |||
908 | platform_device_register(&hd64465_device); | ||
909 | |||
910 | for (i=0; i<HS_MAX_SOCKETS; i++) { | ||
911 | unsigned int ret; | ||
912 | hs_sockets[i].socket.dev.parent = &hd64465_device.dev; | ||
913 | hs_sockets[i].number = i; | ||
914 | ret = pcmcia_register_socket(&hs_sockets[i].socket); | ||
915 | if (ret && i) | ||
916 | pcmcia_unregister_socket(&hs_sockets[0].socket); | ||
917 | } | ||
918 | |||
919 | return 0; | ||
920 | } | ||
921 | |||
922 | static void __exit exit_hs(void) | ||
923 | { | ||
924 | int i; | ||
925 | |||
926 | for (i=0 ; i<HS_MAX_SOCKETS ; i++) { | ||
927 | pcmcia_unregister_socket(&hs_sockets[i].socket); | ||
928 | hs_exit_socket(&hs_sockets[i]); | ||
929 | } | ||
930 | |||
931 | platform_device_unregister(&hd64465_device); | ||
932 | unregister_driver(&hd64465_driver); | ||
933 | } | ||
934 | |||
935 | module_init(init_hs); | ||
936 | module_exit(exit_hs); | ||
937 | |||
938 | /*============================================================*/ | ||
939 | /*END*/ | ||
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 079e9ed907e0..ecdea44ae4e5 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -446,9 +446,6 @@ static int rtc_dev_release(struct inode *inode, struct file *file) | |||
446 | if (rtc->ops->release) | 446 | if (rtc->ops->release) |
447 | rtc->ops->release(rtc->dev.parent); | 447 | rtc->ops->release(rtc->dev.parent); |
448 | 448 | ||
449 | if (file->f_flags & FASYNC) | ||
450 | rtc_dev_fasync(-1, file, 0); | ||
451 | |||
452 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); | 449 | clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); |
453 | return 0; | 450 | return 0; |
454 | } | 451 | } |
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c index 04b63dab6932..43afb7ab5289 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c | |||
@@ -87,6 +87,10 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm) | |||
87 | dev_dbg(dev, "Century bit is enabled\n"); | 87 | dev_dbg(dev, "Century bit is enabled\n"); |
88 | tm->tm_year += 100; /* one century */ | 88 | tm->tm_year += 100; /* one century */ |
89 | } | 89 | } |
90 | #ifdef CONFIG_SPARC | ||
91 | /* Sun SPARC machines count years since 1968 */ | ||
92 | tm->tm_year += 68; | ||
93 | #endif | ||
90 | 94 | ||
91 | tm->tm_wday = bcd2bin(val & 0x07); | 95 | tm->tm_wday = bcd2bin(val & 0x07); |
92 | tm->tm_hour = bcd2bin(M48T59_READ(M48T59_HOUR) & 0x3F); | 96 | tm->tm_hour = bcd2bin(M48T59_READ(M48T59_HOUR) & 0x3F); |
@@ -110,11 +114,20 @@ static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
110 | struct m48t59_private *m48t59 = platform_get_drvdata(pdev); | 114 | struct m48t59_private *m48t59 = platform_get_drvdata(pdev); |
111 | unsigned long flags; | 115 | unsigned long flags; |
112 | u8 val = 0; | 116 | u8 val = 0; |
117 | int year = tm->tm_year; | ||
118 | |||
119 | #ifdef CONFIG_SPARC | ||
120 | /* Sun SPARC machines count years since 1968 */ | ||
121 | year -= 68; | ||
122 | #endif | ||
113 | 123 | ||
114 | dev_dbg(dev, "RTC set time %04d-%02d-%02d %02d/%02d/%02d\n", | 124 | dev_dbg(dev, "RTC set time %04d-%02d-%02d %02d/%02d/%02d\n", |
115 | tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, | 125 | year + 1900, tm->tm_mon, tm->tm_mday, |
116 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 126 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
117 | 127 | ||
128 | if (year < 0) | ||
129 | return -EINVAL; | ||
130 | |||
118 | spin_lock_irqsave(&m48t59->lock, flags); | 131 | spin_lock_irqsave(&m48t59->lock, flags); |
119 | /* Issue the WRITE command */ | 132 | /* Issue the WRITE command */ |
120 | M48T59_SET_BITS(M48T59_CNTL_WRITE, M48T59_CNTL); | 133 | M48T59_SET_BITS(M48T59_CNTL_WRITE, M48T59_CNTL); |
@@ -125,9 +138,9 @@ static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm) | |||
125 | M48T59_WRITE((bin2bcd(tm->tm_mday) & 0x3F), M48T59_MDAY); | 138 | M48T59_WRITE((bin2bcd(tm->tm_mday) & 0x3F), M48T59_MDAY); |
126 | /* tm_mon is 0-11 */ | 139 | /* tm_mon is 0-11 */ |
127 | M48T59_WRITE((bin2bcd(tm->tm_mon + 1) & 0x1F), M48T59_MONTH); | 140 | M48T59_WRITE((bin2bcd(tm->tm_mon + 1) & 0x1F), M48T59_MONTH); |
128 | M48T59_WRITE(bin2bcd(tm->tm_year % 100), M48T59_YEAR); | 141 | M48T59_WRITE(bin2bcd(year % 100), M48T59_YEAR); |
129 | 142 | ||
130 | if (pdata->type == M48T59RTC_TYPE_M48T59 && (tm->tm_year / 100)) | 143 | if (pdata->type == M48T59RTC_TYPE_M48T59 && (year / 100)) |
131 | val = (M48T59_WDAY_CEB | M48T59_WDAY_CB); | 144 | val = (M48T59_WDAY_CEB | M48T59_WDAY_CB); |
132 | val |= (bin2bcd(tm->tm_wday) & 0x07); | 145 | val |= (bin2bcd(tm->tm_wday) & 0x07); |
133 | M48T59_WRITE(val, M48T59_WDAY); | 146 | M48T59_WRITE(val, M48T59_WDAY); |
@@ -159,6 +172,10 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
159 | M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL); | 172 | M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL); |
160 | 173 | ||
161 | tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR)); | 174 | tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR)); |
175 | #ifdef CONFIG_SPARC | ||
176 | /* Sun SPARC machines count years since 1968 */ | ||
177 | tm->tm_year += 68; | ||
178 | #endif | ||
162 | /* tm_mon is 0-11 */ | 179 | /* tm_mon is 0-11 */ |
163 | tm->tm_mon = bcd2bin(M48T59_READ(M48T59_MONTH)) - 1; | 180 | tm->tm_mon = bcd2bin(M48T59_READ(M48T59_MONTH)) - 1; |
164 | 181 | ||
@@ -192,11 +209,20 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
192 | struct rtc_time *tm = &alrm->time; | 209 | struct rtc_time *tm = &alrm->time; |
193 | u8 mday, hour, min, sec; | 210 | u8 mday, hour, min, sec; |
194 | unsigned long flags; | 211 | unsigned long flags; |
212 | int year = tm->tm_year; | ||
213 | |||
214 | #ifdef CONFIG_SPARC | ||
215 | /* Sun SPARC machines count years since 1968 */ | ||
216 | year -= 68; | ||
217 | #endif | ||
195 | 218 | ||
196 | /* If no irq, we don't support ALARM */ | 219 | /* If no irq, we don't support ALARM */ |
197 | if (m48t59->irq == NO_IRQ) | 220 | if (m48t59->irq == NO_IRQ) |
198 | return -EIO; | 221 | return -EIO; |
199 | 222 | ||
223 | if (year < 0) | ||
224 | return -EINVAL; | ||
225 | |||
200 | /* | 226 | /* |
201 | * 0xff means "always match" | 227 | * 0xff means "always match" |
202 | */ | 228 | */ |
@@ -228,7 +254,7 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
228 | spin_unlock_irqrestore(&m48t59->lock, flags); | 254 | spin_unlock_irqrestore(&m48t59->lock, flags); |
229 | 255 | ||
230 | dev_dbg(dev, "RTC set alarm time %04d-%02d-%02d %02d/%02d/%02d\n", | 256 | dev_dbg(dev, "RTC set alarm time %04d-%02d-%02d %02d/%02d/%02d\n", |
231 | tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, | 257 | year + 1900, tm->tm_mon, tm->tm_mday, |
232 | tm->tm_hour, tm->tm_min, tm->tm_sec); | 258 | tm->tm_hour, tm->tm_min, tm->tm_sec); |
233 | return 0; | 259 | return 0; |
234 | } | 260 | } |
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index afe1de998763..a454f94623d7 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c | |||
@@ -2988,17 +2988,6 @@ static int megasas_mgmt_open(struct inode *inode, struct file *filep) | |||
2988 | } | 2988 | } |
2989 | 2989 | ||
2990 | /** | 2990 | /** |
2991 | * megasas_mgmt_release - char node "release" entry point | ||
2992 | */ | ||
2993 | static int megasas_mgmt_release(struct inode *inode, struct file *filep) | ||
2994 | { | ||
2995 | filep->private_data = NULL; | ||
2996 | fasync_helper(-1, filep, 0, &megasas_async_queue); | ||
2997 | |||
2998 | return 0; | ||
2999 | } | ||
3000 | |||
3001 | /** | ||
3002 | * megasas_mgmt_fasync - Async notifier registration from applications | 2991 | * megasas_mgmt_fasync - Async notifier registration from applications |
3003 | * | 2992 | * |
3004 | * This function adds the calling process to a driver global queue. When an | 2993 | * This function adds the calling process to a driver global queue. When an |
@@ -3345,7 +3334,6 @@ megasas_mgmt_compat_ioctl(struct file *file, unsigned int cmd, | |||
3345 | static const struct file_operations megasas_mgmt_fops = { | 3334 | static const struct file_operations megasas_mgmt_fops = { |
3346 | .owner = THIS_MODULE, | 3335 | .owner = THIS_MODULE, |
3347 | .open = megasas_mgmt_open, | 3336 | .open = megasas_mgmt_open, |
3348 | .release = megasas_mgmt_release, | ||
3349 | .fasync = megasas_mgmt_fasync, | 3337 | .fasync = megasas_mgmt_fasync, |
3350 | .unlocked_ioctl = megasas_mgmt_ioctl, | 3338 | .unlocked_ioctl = megasas_mgmt_ioctl, |
3351 | #ifdef CONFIG_COMPAT | 3339 | #ifdef CONFIG_COMPAT |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 9adf35bd8b56..5103855242ae 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -327,7 +327,6 @@ sg_release(struct inode *inode, struct file *filp) | |||
327 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) | 327 | if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) |
328 | return -ENXIO; | 328 | return -ENXIO; |
329 | SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name)); | 329 | SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name)); |
330 | sg_fasync(-1, filp, 0); /* remove filp from async notification list */ | ||
331 | if (0 == sg_remove_sfp(sdp, sfp)) { /* Returns 1 when sdp gone */ | 330 | if (0 == sg_remove_sfp(sdp, sfp)) { /* Returns 1 when sdp gone */ |
332 | if (!sdp->detached) { | 331 | if (!sdp->detached) { |
333 | scsi_device_put(sdp->device); | 332 | scsi_device_put(sdp->device); |
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index 211c21797ce0..8b2c619a09f2 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
@@ -34,14 +34,14 @@ static char *serial_version = "$Revision: 1.25 $"; | |||
34 | #include <asm/system.h> | 34 | #include <asm/system.h> |
35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
36 | 36 | ||
37 | #include <asm/arch/svinto.h> | 37 | #include <arch/svinto.h> |
38 | 38 | ||
39 | /* non-arch dependent serial structures are in linux/serial.h */ | 39 | /* non-arch dependent serial structures are in linux/serial.h */ |
40 | #include <linux/serial.h> | 40 | #include <linux/serial.h> |
41 | /* while we keep our own stuff (struct e100_serial) in a local .h file */ | 41 | /* while we keep our own stuff (struct e100_serial) in a local .h file */ |
42 | #include "crisv10.h" | 42 | #include "crisv10.h" |
43 | #include <asm/fasttimer.h> | 43 | #include <asm/fasttimer.h> |
44 | #include <asm/arch/io_interface_mux.h> | 44 | #include <arch/io_interface_mux.h> |
45 | 45 | ||
46 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER | 46 | #ifdef CONFIG_ETRAX_SERIAL_FAST_TIMER |
47 | #ifndef CONFIG_ETRAX_FAST_TIMER | 47 | #ifndef CONFIG_ETRAX_FAST_TIMER |
diff --git a/drivers/serial/crisv10.h b/drivers/serial/crisv10.h index e3c5c8c3c09b..f36a729280bc 100644 --- a/drivers/serial/crisv10.h +++ b/drivers/serial/crisv10.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <linux/circ_buf.h> | 10 | #include <linux/circ_buf.h> |
11 | #include <asm/termios.h> | 11 | #include <asm/termios.h> |
12 | #include <asm/dma.h> | 12 | #include <asm/dma.h> |
13 | #include <asm/arch/io_interface_mux.h> | 13 | #include <arch/io_interface_mux.h> |
14 | 14 | ||
15 | /* Software state per channel */ | 15 | /* Software state per channel */ |
16 | 16 | ||
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index f0658d2c45b2..5c0f32c7fbf6 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -250,8 +250,7 @@ static inline void h8300_sci_disable(struct uart_port *port) | |||
250 | } | 250 | } |
251 | #endif | 251 | #endif |
252 | 252 | ||
253 | #if defined(SCI_ONLY) || defined(SCI_AND_SCIF) && \ | 253 | #if defined(__H8300H__) || defined(__H8300S__) |
254 | defined(__H8300H__) || defined(__H8300S__) | ||
255 | static void sci_init_pins_sci(struct uart_port* port, unsigned int cflag) | 254 | static void sci_init_pins_sci(struct uart_port* port, unsigned int cflag) |
256 | { | 255 | { |
257 | int ch = (port->mapbase - SMR0) >> 3; | 256 | int ch = (port->mapbase - SMR0) >> 3; |
@@ -285,11 +284,6 @@ static void sci_init_pins_irda(struct uart_port *port, unsigned int cflag) | |||
285 | #define sci_init_pins_irda NULL | 284 | #define sci_init_pins_irda NULL |
286 | #endif | 285 | #endif |
287 | 286 | ||
288 | #ifdef SCI_ONLY | ||
289 | #define sci_init_pins_scif NULL | ||
290 | #endif | ||
291 | |||
292 | #if defined(SCIF_ONLY) || defined(SCI_AND_SCIF) | ||
293 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 287 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
294 | static void sci_init_pins_scif(struct uart_port* port, unsigned int cflag) | 288 | static void sci_init_pins_scif(struct uart_port* port, unsigned int cflag) |
295 | { | 289 | { |
@@ -449,7 +443,6 @@ static inline int scif_rxroom(struct uart_port *port) | |||
449 | return sci_in(port, SCFDR) & SCIF_RFDC_MASK; | 443 | return sci_in(port, SCFDR) & SCIF_RFDC_MASK; |
450 | } | 444 | } |
451 | #endif | 445 | #endif |
452 | #endif /* SCIF_ONLY || SCI_AND_SCIF */ | ||
453 | 446 | ||
454 | static inline int sci_txroom(struct uart_port *port) | 447 | static inline int sci_txroom(struct uart_port *port) |
455 | { | 448 | { |
@@ -485,11 +478,9 @@ static void sci_transmit_chars(struct uart_port *port) | |||
485 | return; | 478 | return; |
486 | } | 479 | } |
487 | 480 | ||
488 | #ifndef SCI_ONLY | ||
489 | if (port->type == PORT_SCIF) | 481 | if (port->type == PORT_SCIF) |
490 | count = scif_txroom(port); | 482 | count = scif_txroom(port); |
491 | else | 483 | else |
492 | #endif | ||
493 | count = sci_txroom(port); | 484 | count = sci_txroom(port); |
494 | 485 | ||
495 | do { | 486 | do { |
@@ -519,12 +510,10 @@ static void sci_transmit_chars(struct uart_port *port) | |||
519 | } else { | 510 | } else { |
520 | ctrl = sci_in(port, SCSCR); | 511 | ctrl = sci_in(port, SCSCR); |
521 | 512 | ||
522 | #if !defined(SCI_ONLY) | ||
523 | if (port->type == PORT_SCIF) { | 513 | if (port->type == PORT_SCIF) { |
524 | sci_in(port, SCxSR); /* Dummy read */ | 514 | sci_in(port, SCxSR); /* Dummy read */ |
525 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 515 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); |
526 | } | 516 | } |
527 | #endif | ||
528 | 517 | ||
529 | ctrl |= SCI_CTRL_FLAGS_TIE; | 518 | ctrl |= SCI_CTRL_FLAGS_TIE; |
530 | sci_out(port, SCSCR, ctrl); | 519 | sci_out(port, SCSCR, ctrl); |
@@ -547,11 +536,9 @@ static inline void sci_receive_chars(struct uart_port *port) | |||
547 | return; | 536 | return; |
548 | 537 | ||
549 | while (1) { | 538 | while (1) { |
550 | #if !defined(SCI_ONLY) | ||
551 | if (port->type == PORT_SCIF) | 539 | if (port->type == PORT_SCIF) |
552 | count = scif_rxroom(port); | 540 | count = scif_rxroom(port); |
553 | else | 541 | else |
554 | #endif | ||
555 | count = sci_rxroom(port); | 542 | count = sci_rxroom(port); |
556 | 543 | ||
557 | /* Don't copy more bytes than there is room for in the buffer */ | 544 | /* Don't copy more bytes than there is room for in the buffer */ |
@@ -810,26 +797,27 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) | |||
810 | 797 | ||
811 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | 798 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) |
812 | { | 799 | { |
813 | unsigned short ssr_status, scr_status; | 800 | unsigned short ssr_status, scr_status; |
814 | struct uart_port *port = ptr; | 801 | struct uart_port *port = ptr; |
802 | irqreturn_t ret = IRQ_NONE; | ||
815 | 803 | ||
816 | ssr_status = sci_in(port,SCxSR); | 804 | ssr_status = sci_in(port,SCxSR); |
817 | scr_status = sci_in(port,SCSCR); | 805 | scr_status = sci_in(port,SCSCR); |
818 | 806 | ||
819 | /* Tx Interrupt */ | 807 | /* Tx Interrupt */ |
820 | if ((ssr_status & 0x0020) && (scr_status & 0x0080)) | 808 | if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE)) |
821 | sci_tx_interrupt(irq, ptr); | 809 | ret = sci_tx_interrupt(irq, ptr); |
822 | /* Rx Interrupt */ | 810 | /* Rx Interrupt */ |
823 | if ((ssr_status & 0x0002) && (scr_status & 0x0040)) | 811 | if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE)) |
824 | sci_rx_interrupt(irq, ptr); | 812 | ret = sci_rx_interrupt(irq, ptr); |
825 | /* Error Interrupt */ | 813 | /* Error Interrupt */ |
826 | if ((ssr_status & 0x0080) && (scr_status & 0x0400)) | 814 | if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE)) |
827 | sci_er_interrupt(irq, ptr); | 815 | ret = sci_er_interrupt(irq, ptr); |
828 | /* Break Interrupt */ | 816 | /* Break Interrupt */ |
829 | if ((ssr_status & 0x0010) && (scr_status & 0x0200)) | 817 | if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE)) |
830 | sci_br_interrupt(irq, ptr); | 818 | ret = sci_br_interrupt(irq, ptr); |
831 | 819 | ||
832 | return IRQ_HANDLED; | 820 | return ret; |
833 | } | 821 | } |
834 | 822 | ||
835 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_HAVE_CLK) | 823 | #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_HAVE_CLK) |
@@ -1054,10 +1042,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1054 | 1042 | ||
1055 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ | 1043 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ |
1056 | 1044 | ||
1057 | #if !defined(SCI_ONLY) | ||
1058 | if (port->type == PORT_SCIF) | 1045 | if (port->type == PORT_SCIF) |
1059 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); | 1046 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); |
1060 | #endif | ||
1061 | 1047 | ||
1062 | smr_val = sci_in(port, SCSMR) & 3; | 1048 | smr_val = sci_in(port, SCSMR) & 3; |
1063 | if ((termios->c_cflag & CSIZE) == CS7) | 1049 | if ((termios->c_cflag & CSIZE) == CS7) |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 7cd28b226800..6163a45f968f 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -16,7 +16,6 @@ | |||
16 | # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */ | 16 | # define SCPCR 0xA4000116 /* 16 bit SCI and SCIF */ |
17 | # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */ | 17 | # define SCPDR 0xA4000136 /* 8 bit SCI and SCIF */ |
18 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 18 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
19 | # define SCI_AND_SCIF | ||
20 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) | 19 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) |
21 | # define SCIF0 0xA4400000 | 20 | # define SCIF0 0xA4400000 |
22 | # define SCIF2 0xA4410000 | 21 | # define SCIF2 0xA4410000 |
@@ -30,17 +29,15 @@ | |||
30 | * SCIF0 (0xA4400000) -> Internal clock, SCK pin as serial clock output | 29 | * SCIF0 (0xA4400000) -> Internal clock, SCK pin as serial clock output |
31 | */ | 30 | */ |
32 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 | 31 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 |
33 | # define SCIF_ONLY | ||
34 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 32 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
35 | defined(CONFIG_CPU_SUBTYPE_SH7721) | 33 | defined(CONFIG_CPU_SUBTYPE_SH7721) |
36 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ | 34 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ |
37 | # define SCIF_ONLY | ||
38 | #define SCIF_ORER 0x0200 /* overrun error bit */ | 35 | #define SCIF_ORER 0x0200 /* overrun error bit */ |
39 | #elif defined(CONFIG_SH_RTS7751R2D) | 36 | #elif defined(CONFIG_SH_RTS7751R2D) |
37 | # define SCSPTR1 0xFFE0001C /* 8 bit SCIF */ | ||
40 | # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ | 38 | # define SCSPTR2 0xFFE80020 /* 16 bit SCIF */ |
41 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 39 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
42 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 40 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
43 | # define SCIF_ONLY | ||
44 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 41 | #elif defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
45 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | 42 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ |
46 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | 43 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ |
@@ -53,28 +50,24 @@ | |||
53 | # define SCSCR_INIT(port) (((port)->type == PORT_SCI) ? \ | 50 | # define SCSCR_INIT(port) (((port)->type == PORT_SCI) ? \ |
54 | 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \ | 51 | 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \ |
55 | 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ ) | 52 | 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ ) |
56 | # define SCI_AND_SCIF | ||
57 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) | 53 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) |
58 | # define SCSPTR0 0xfe600024 /* 16 bit SCIF */ | 54 | # define SCSPTR0 0xfe600024 /* 16 bit SCIF */ |
59 | # define SCSPTR1 0xfe610024 /* 16 bit SCIF */ | 55 | # define SCSPTR1 0xfe610024 /* 16 bit SCIF */ |
60 | # define SCSPTR2 0xfe620024 /* 16 bit SCIF */ | 56 | # define SCSPTR2 0xfe620024 /* 16 bit SCIF */ |
61 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 57 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
62 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 58 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
63 | # define SCIF_ONLY | ||
64 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 59 | #elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
65 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ | 60 | # define SCSPTR0 0xA4400000 /* 16 bit SCIF */ |
66 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 61 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
67 | # define PACR 0xa4050100 | 62 | # define PACR 0xa4050100 |
68 | # define PBCR 0xa4050102 | 63 | # define PBCR 0xa4050102 |
69 | # define SCSCR_INIT(port) 0x3B | 64 | # define SCSCR_INIT(port) 0x3B |
70 | # define SCIF_ONLY | ||
71 | #elif defined(CONFIG_CPU_SUBTYPE_SH7343) | 65 | #elif defined(CONFIG_CPU_SUBTYPE_SH7343) |
72 | # define SCSPTR0 0xffe00010 /* 16 bit SCIF */ | 66 | # define SCSPTR0 0xffe00010 /* 16 bit SCIF */ |
73 | # define SCSPTR1 0xffe10010 /* 16 bit SCIF */ | 67 | # define SCSPTR1 0xffe10010 /* 16 bit SCIF */ |
74 | # define SCSPTR2 0xffe20010 /* 16 bit SCIF */ | 68 | # define SCSPTR2 0xffe20010 /* 16 bit SCIF */ |
75 | # define SCSPTR3 0xffe30010 /* 16 bit SCIF */ | 69 | # define SCSPTR3 0xffe30010 /* 16 bit SCIF */ |
76 | # define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ | 70 | # define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ |
77 | # define SCIF_ONLY | ||
78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | 71 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) |
79 | # define PADR 0xA4050120 | 72 | # define PADR 0xA4050120 |
80 | # define PSDR 0xA405013e | 73 | # define PSDR 0xA405013e |
@@ -82,7 +75,6 @@ | |||
82 | # define PSCR 0xA405011E | 75 | # define PSCR 0xA405011E |
83 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 76 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
84 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 77 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
85 | # define SCIF_ONLY | ||
86 | #elif defined(CONFIG_CPU_SUBTYPE_SH7366) | 78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7366) |
87 | # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ | 79 | # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ |
88 | # define SCSPTR0 SCPDR0 | 80 | # define SCSPTR0 SCPDR0 |
@@ -97,12 +89,10 @@ | |||
97 | # define SCSPTR5 0xa4050128 | 89 | # define SCSPTR5 0xa4050128 |
98 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 90 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
99 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 91 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
100 | # define SCIF_ONLY | ||
101 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) | 92 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) |
102 | # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ | 93 | # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ |
103 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 94 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
104 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 95 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
105 | # define SCIF_ONLY | ||
106 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) | 96 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) |
107 | # define SCIF_BASE_ADDR 0x01030000 | 97 | # define SCIF_BASE_ADDR 0x01030000 |
108 | # define SCIF_ADDR_SH5 PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR | 98 | # define SCIF_ADDR_SH5 PHYS_PERIPHERAL_BLOCK+SCIF_BASE_ADDR |
@@ -111,14 +101,11 @@ | |||
111 | # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ | 101 | # define SCSPTR2 ((port->mapbase)+SCIF_PTR2_OFFS) /* 16 bit SCIF */ |
112 | # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ | 102 | # define SCLSR2 ((port->mapbase)+SCIF_LSR2_OFFS) /* 16 bit SCIF */ |
113 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */ | 103 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0, TE=1,RE=1,REIE=1 */ |
114 | # define SCIF_ONLY | ||
115 | #elif defined(CONFIG_H83007) || defined(CONFIG_H83068) | 104 | #elif defined(CONFIG_H83007) || defined(CONFIG_H83068) |
116 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 105 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
117 | # define SCI_ONLY | ||
118 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) | 106 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) |
119 | #elif defined(CONFIG_H8S2678) | 107 | #elif defined(CONFIG_H8S2678) |
120 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ | 108 | # define SCSCR_INIT(port) 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ |
121 | # define SCI_ONLY | ||
122 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) | 109 | # define H8300_SCI_DR(ch) *(volatile char *)(P1DR + h8300_sci_pins[ch].port) |
123 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) | 110 | #elif defined(CONFIG_CPU_SUBTYPE_SH7763) |
124 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ | 111 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ |
@@ -126,20 +113,17 @@ | |||
126 | # define SCSPTR2 0xffe10020 /* 16 bit SCIF/IRDA */ | 113 | # define SCSPTR2 0xffe10020 /* 16 bit SCIF/IRDA */ |
127 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 114 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
128 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 115 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
129 | # define SCIF_ONLY | ||
130 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) | 116 | #elif defined(CONFIG_CPU_SUBTYPE_SH7770) |
131 | # define SCSPTR0 0xff923020 /* 16 bit SCIF */ | 117 | # define SCSPTR0 0xff923020 /* 16 bit SCIF */ |
132 | # define SCSPTR1 0xff924020 /* 16 bit SCIF */ | 118 | # define SCSPTR1 0xff924020 /* 16 bit SCIF */ |
133 | # define SCSPTR2 0xff925020 /* 16 bit SCIF */ | 119 | # define SCSPTR2 0xff925020 /* 16 bit SCIF */ |
134 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 120 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
135 | # define SCSCR_INIT(port) 0x3c /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,cke=2 */ | 121 | # define SCSCR_INIT(port) 0x3c /* TIE=0,RIE=0,TE=1,RE=1,REIE=1,cke=2 */ |
136 | # define SCIF_ONLY | ||
137 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) | 122 | #elif defined(CONFIG_CPU_SUBTYPE_SH7780) |
138 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ | 123 | # define SCSPTR0 0xffe00024 /* 16 bit SCIF */ |
139 | # define SCSPTR1 0xffe10024 /* 16 bit SCIF */ | 124 | # define SCSPTR1 0xffe10024 /* 16 bit SCIF */ |
140 | # define SCIF_ORER 0x0001 /* Overrun error bit */ | 125 | # define SCIF_ORER 0x0001 /* Overrun error bit */ |
141 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 126 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
142 | # define SCIF_ONLY | ||
143 | #elif defined(CONFIG_CPU_SUBTYPE_SH7785) | 127 | #elif defined(CONFIG_CPU_SUBTYPE_SH7785) |
144 | # define SCSPTR0 0xffea0024 /* 16 bit SCIF */ | 128 | # define SCSPTR0 0xffea0024 /* 16 bit SCIF */ |
145 | # define SCSPTR1 0xffeb0024 /* 16 bit SCIF */ | 129 | # define SCSPTR1 0xffeb0024 /* 16 bit SCIF */ |
@@ -149,7 +133,6 @@ | |||
149 | # define SCSPTR5 0xffef0024 /* 16 bit SCIF */ | 133 | # define SCSPTR5 0xffef0024 /* 16 bit SCIF */ |
150 | # define SCIF_OPER 0x0001 /* Overrun error bit */ | 134 | # define SCIF_OPER 0x0001 /* Overrun error bit */ |
151 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 135 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
152 | # define SCIF_ONLY | ||
153 | #elif defined(CONFIG_CPU_SUBTYPE_SH7203) || \ | 136 | #elif defined(CONFIG_CPU_SUBTYPE_SH7203) || \ |
154 | defined(CONFIG_CPU_SUBTYPE_SH7206) || \ | 137 | defined(CONFIG_CPU_SUBTYPE_SH7206) || \ |
155 | defined(CONFIG_CPU_SUBTYPE_SH7263) | 138 | defined(CONFIG_CPU_SUBTYPE_SH7263) |
@@ -158,14 +141,12 @@ | |||
158 | # define SCSPTR2 0xfffe9020 /* 16 bit SCIF */ | 141 | # define SCSPTR2 0xfffe9020 /* 16 bit SCIF */ |
159 | # define SCSPTR3 0xfffe9820 /* 16 bit SCIF */ | 142 | # define SCSPTR3 0xfffe9820 /* 16 bit SCIF */ |
160 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 143 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
161 | # define SCIF_ONLY | ||
162 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) | 144 | #elif defined(CONFIG_CPU_SUBTYPE_SH7619) |
163 | # define SCSPTR0 0xf8400020 /* 16 bit SCIF */ | 145 | # define SCSPTR0 0xf8400020 /* 16 bit SCIF */ |
164 | # define SCSPTR1 0xf8410020 /* 16 bit SCIF */ | 146 | # define SCSPTR1 0xf8410020 /* 16 bit SCIF */ |
165 | # define SCSPTR2 0xf8420020 /* 16 bit SCIF */ | 147 | # define SCSPTR2 0xf8420020 /* 16 bit SCIF */ |
166 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 148 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
167 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 149 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
168 | # define SCIF_ONLY | ||
169 | #elif defined(CONFIG_CPU_SUBTYPE_SHX3) | 150 | #elif defined(CONFIG_CPU_SUBTYPE_SHX3) |
170 | # define SCSPTR0 0xffc30020 /* 16 bit SCIF */ | 151 | # define SCSPTR0 0xffc30020 /* 16 bit SCIF */ |
171 | # define SCSPTR1 0xffc40020 /* 16 bit SCIF */ | 152 | # define SCSPTR1 0xffc40020 /* 16 bit SCIF */ |
@@ -173,7 +154,6 @@ | |||
173 | # define SCSPTR3 0xffc60020 /* 16 bit SCIF */ | 154 | # define SCSPTR3 0xffc60020 /* 16 bit SCIF */ |
174 | # define SCIF_ORER 0x0001 /* Overrun error bit */ | 155 | # define SCIF_ORER 0x0001 /* Overrun error bit */ |
175 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 156 | # define SCSCR_INIT(port) 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
176 | # define SCIF_ONLY | ||
177 | #else | 157 | #else |
178 | # error CPU subtype not defined | 158 | # error CPU subtype not defined |
179 | #endif | 159 | #endif |
@@ -186,6 +166,7 @@ | |||
186 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ | 166 | #if defined(CONFIG_CPU_SUBTYPE_SH7750) || \ |
187 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ | 167 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ |
188 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | 168 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ |
169 | defined(CONFIG_CPU_SUBTYPE_SH7722) || \ | ||
189 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | 170 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ |
190 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ | 171 | defined(CONFIG_CPU_SUBTYPE_SH7751) || \ |
191 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | 172 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ |
@@ -244,55 +225,28 @@ | |||
244 | # define SCIF_TXROOM_MAX 16 | 225 | # define SCIF_TXROOM_MAX 16 |
245 | #endif | 226 | #endif |
246 | 227 | ||
247 | #if defined(SCI_ONLY) | 228 | #define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND) |
248 | # define SCxSR_TEND(port) SCI_TEND | 229 | #define SCxSR_ERRORS(port) (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS) |
249 | # define SCxSR_ERRORS(port) SCI_ERRORS | 230 | #define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF) |
250 | # define SCxSR_RDxF(port) SCI_RDRF | 231 | #define SCxSR_TDxE(port) (((port)->type == PORT_SCI) ? SCI_TDRE : SCIF_TDFE) |
251 | # define SCxSR_TDxE(port) SCI_TDRE | 232 | #define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER) |
252 | # define SCxSR_ORER(port) SCI_ORER | 233 | #define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER) |
253 | # define SCxSR_FER(port) SCI_FER | 234 | #define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK) |
254 | # define SCxSR_PER(port) SCI_PER | 235 | |
255 | # define SCxSR_BRK(port) 0x00 | ||
256 | # define SCxSR_RDxF_CLEAR(port) 0xbc | ||
257 | # define SCxSR_ERROR_CLEAR(port) 0xc4 | ||
258 | # define SCxSR_TDxE_CLEAR(port) 0x78 | ||
259 | # define SCxSR_BREAK_CLEAR(port) 0xc4 | ||
260 | #elif defined(SCIF_ONLY) | ||
261 | # define SCxSR_TEND(port) SCIF_TEND | ||
262 | # define SCxSR_ERRORS(port) SCIF_ERRORS | ||
263 | # define SCxSR_RDxF(port) SCIF_RDF | ||
264 | # define SCxSR_TDxE(port) SCIF_TDFE | ||
265 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) | 236 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) |
266 | # define SCxSR_ORER(port) SCIF_ORER | 237 | # define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : SCIF_ORER) |
267 | #else | 238 | #else |
268 | # define SCxSR_ORER(port) 0x0000 | 239 | # define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : 0x0000) |
269 | #endif | 240 | #endif |
270 | # define SCxSR_FER(port) SCIF_FER | 241 | |
271 | # define SCxSR_PER(port) SCIF_PER | ||
272 | # define SCxSR_BRK(port) SCIF_BRK | ||
273 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 242 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
274 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 243 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
275 | defined(CONFIG_CPU_SUBTYPE_SH7721) | 244 | defined(CONFIG_CPU_SUBTYPE_SH7721) |
276 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port,SCxSR)&0xfffc) | 245 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) |
277 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port,SCxSR)&0xfd73) | 246 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) |
278 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port,SCxSR)&0xffdf) | 247 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) |
279 | # define SCxSR_BREAK_CLEAR(port) (sci_in(port,SCxSR)&0xffe3) | 248 | # define SCxSR_BREAK_CLEAR(port) (sci_in(port, SCxSR) & 0xffe3) |
280 | #else | ||
281 | /* SH7705 can also use this, clearing is same between 7705 and 7709 */ | ||
282 | # define SCxSR_RDxF_CLEAR(port) 0x00fc | ||
283 | # define SCxSR_ERROR_CLEAR(port) 0x0073 | ||
284 | # define SCxSR_TDxE_CLEAR(port) 0x00df | ||
285 | # define SCxSR_BREAK_CLEAR(port) 0x00e3 | ||
286 | #endif | ||
287 | #else | 249 | #else |
288 | # define SCxSR_TEND(port) (((port)->type == PORT_SCI) ? SCI_TEND : SCIF_TEND) | ||
289 | # define SCxSR_ERRORS(port) (((port)->type == PORT_SCI) ? SCI_ERRORS : SCIF_ERRORS) | ||
290 | # define SCxSR_RDxF(port) (((port)->type == PORT_SCI) ? SCI_RDRF : SCIF_RDF) | ||
291 | # define SCxSR_TDxE(port) (((port)->type == PORT_SCI) ? SCI_TDRE : SCIF_TDFE) | ||
292 | # define SCxSR_ORER(port) (((port)->type == PORT_SCI) ? SCI_ORER : 0x0000) | ||
293 | # define SCxSR_FER(port) (((port)->type == PORT_SCI) ? SCI_FER : SCIF_FER) | ||
294 | # define SCxSR_PER(port) (((port)->type == PORT_SCI) ? SCI_PER : SCIF_PER) | ||
295 | # define SCxSR_BRK(port) (((port)->type == PORT_SCI) ? 0x00 : SCIF_BRK) | ||
296 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) | 250 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) |
297 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) | 251 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) |
298 | # define SCxSR_TDxE_CLEAR(port) (((port)->type == PORT_SCI) ? 0x78 : 0x00df) | 252 | # define SCxSR_TDxE_CLEAR(port) (((port)->type == PORT_SCI) ? 0x78 : 0x00df) |
@@ -574,18 +528,20 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
574 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ | 528 | defined(CONFIG_CPU_SUBTYPE_SH7751R) || \ |
575 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ | 529 | defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ |
576 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ | 530 | defined(CONFIG_CPU_SUBTYPE_SH7750S) || \ |
577 | defined(CONFIG_CPU_SUBTYPE_SH7091) || \ | 531 | defined(CONFIG_CPU_SUBTYPE_SH7091) |
578 | defined(CONFIG_CPU_SUBTYPE_SH4_202) | ||
579 | static inline int sci_rxd_in(struct uart_port *port) | 532 | static inline int sci_rxd_in(struct uart_port *port) |
580 | { | 533 | { |
581 | #ifndef SCIF_ONLY | ||
582 | if (port->mapbase == 0xffe00000) | 534 | if (port->mapbase == 0xffe00000) |
583 | return ctrl_inb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */ | 535 | return ctrl_inb(SCSPTR1)&0x01 ? 1 : 0; /* SCI */ |
584 | #endif | ||
585 | #ifndef SCI_ONLY | ||
586 | if (port->mapbase == 0xffe80000) | 536 | if (port->mapbase == 0xffe80000) |
587 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ | 537 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ |
588 | #endif | 538 | return 1; |
539 | } | ||
540 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) | ||
541 | static inline int sci_rxd_in(struct uart_port *port) | ||
542 | { | ||
543 | if (port->mapbase == 0xffe80000) | ||
544 | return ctrl_inw(SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ | ||
589 | return 1; | 545 | return 1; |
590 | } | 546 | } |
591 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) | 547 | #elif defined(CONFIG_CPU_SUBTYPE_SH7760) |
@@ -651,7 +607,7 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
651 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) | 607 | #elif defined(CONFIG_CPU_SUBTYPE_SH5_101) || defined(CONFIG_CPU_SUBTYPE_SH5_103) |
652 | static inline int sci_rxd_in(struct uart_port *port) | 608 | static inline int sci_rxd_in(struct uart_port *port) |
653 | { | 609 | { |
654 | return sci_in(port, SCSPTR)&0x0001 ? 1 : 0; /* SCIF */ | 610 | return sci_in(port, SCSPTR2)&0x0001 ? 1 : 0; /* SCIF */ |
655 | } | 611 | } |
656 | #elif defined(__H8300H__) || defined(__H8300S__) | 612 | #elif defined(__H8300H__) || defined(__H8300S__) |
657 | static inline int sci_rxd_in(struct uart_port *port) | 613 | static inline int sci_rxd_in(struct uart_port *port) |
diff --git a/drivers/staging/me4000/me4000.c b/drivers/staging/me4000/me4000.c index 0b33773bb4f6..cf8b01bcac8d 100644 --- a/drivers/staging/me4000/me4000.c +++ b/drivers/staging/me4000/me4000.c | |||
@@ -1633,9 +1633,6 @@ static int me4000_release(struct inode *inode_p, struct file *file_p) | |||
1633 | 1633 | ||
1634 | free_irq(ext_int_context->irq, ext_int_context); | 1634 | free_irq(ext_int_context->irq, ext_int_context); |
1635 | 1635 | ||
1636 | /* Delete the fasync structure and free memory */ | ||
1637 | me4000_ext_int_fasync(0, file_p, 0); | ||
1638 | |||
1639 | /* Mark as unused */ | 1636 | /* Mark as unused */ |
1640 | ext_int_context->in_use = 0; | 1637 | ext_int_context->in_use = 0; |
1641 | } else { | 1638 | } else { |
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 41b6530b8f25..a913efc69669 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c | |||
@@ -2328,7 +2328,6 @@ static int ixj_release(struct inode *inode, struct file *file_p) | |||
2328 | j->rec_codec = j->play_codec = 0; | 2328 | j->rec_codec = j->play_codec = 0; |
2329 | j->rec_frame_size = j->play_frame_size = 0; | 2329 | j->rec_frame_size = j->play_frame_size = 0; |
2330 | j->flags.cidsent = j->flags.cidring = 0; | 2330 | j->flags.cidsent = j->flags.cidring = 0; |
2331 | ixj_fasync(-1, file_p, 0); /* remove from list of async notification */ | ||
2332 | 2331 | ||
2333 | if(j->cardtype == QTI_LINEJACK && !j->readers && !j->writers) { | 2332 | if(j->cardtype == QTI_LINEJACK && !j->readers && !j->writers) { |
2334 | ixj_set_port(j, PORT_PSTN); | 2333 | ixj_set_port(j, PORT_PSTN); |
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index f9b4647255aa..2d2440cd57a9 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
@@ -367,9 +367,6 @@ static int uio_release(struct inode *inode, struct file *filep) | |||
367 | ret = idev->info->release(idev->info, inode); | 367 | ret = idev->info->release(idev->info, inode); |
368 | 368 | ||
369 | module_put(idev->owner); | 369 | module_put(idev->owner); |
370 | |||
371 | if (filep->f_flags & FASYNC) | ||
372 | ret = uio_fasync(-1, filep, 0); | ||
373 | kfree(listener); | 370 | kfree(listener); |
374 | return ret; | 371 | return ret; |
375 | } | 372 | } |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index f4585d3e90d7..eeb26c0f88e5 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -1251,7 +1251,6 @@ dev_release (struct inode *inode, struct file *fd) | |||
1251 | * alternatively, all host requests will time out. | 1251 | * alternatively, all host requests will time out. |
1252 | */ | 1252 | */ |
1253 | 1253 | ||
1254 | fasync_helper (-1, fd, 0, &dev->fasync); | ||
1255 | kfree (dev->buf); | 1254 | kfree (dev->buf); |
1256 | dev->buf = NULL; | 1255 | dev->buf = NULL; |
1257 | put_dev (dev); | 1256 | put_dev (dev); |
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 048b139f0e50..8a8760230bc7 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -2049,7 +2049,7 @@ static void cirrusfb_pci_unmap(struct fb_info *info) | |||
2049 | #endif /* CONFIG_PCI */ | 2049 | #endif /* CONFIG_PCI */ |
2050 | 2050 | ||
2051 | #ifdef CONFIG_ZORRO | 2051 | #ifdef CONFIG_ZORRO |
2052 | static void __devexit cirrusfb_zorro_unmap(struct fb_info *info) | 2052 | static void cirrusfb_zorro_unmap(struct fb_info *info) |
2053 | { | 2053 | { |
2054 | struct cirrusfb_info *cinfo = info->par; | 2054 | struct cirrusfb_info *cinfo = info->par; |
2055 | struct zorro_dev *zdev = to_zorro_dev(info->device); | 2055 | struct zorro_dev *zdev = to_zorro_dev(info->device); |