From 070c6999831dc4cfd9b07c74c2fea1964d7adfec Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 27 Mar 2006 01:17:07 -0800 Subject: [PATCH] pnp: cs4232: adjust pnp_register_driver signature Remove the assumption that pnp_register_driver() returns the number of devices claimed. Signed-off-by: Bjorn Helgaas Cc: Adam Belay Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/cs4232.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index 7c59e2d4003a..c7f86f09c28d 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c @@ -360,6 +360,8 @@ static int __initdata synthio = -1; static int __initdata synthirq = -1; static int __initdata isapnp = 1; +static unsigned int cs4232_devices; + MODULE_DESCRIPTION("CS4232 based soundcard driver"); MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); MODULE_LICENSE("GPL"); @@ -421,6 +423,7 @@ static int cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev return -ENODEV; } pnp_set_drvdata(dev,isapnpcfg); + cs4232_devices++; return 0; } @@ -455,10 +458,11 @@ static int __init init_cs4232(void) #endif cfg.irq = -1; - if (isapnp && - (pnp_register_driver(&cs4232_driver) > 0) - ) - return 0; + if (isapnp) { + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) + return 0; + } if(io==-1||irq==-1||dma==-1) { @@ -503,7 +507,8 @@ static int __init setup_cs4232(char *str) int ints[7]; /* If we have isapnp cards, no need for options */ - if (pnp_register_driver(&cs4232_driver) > 0) + pnp_register_driver(&cs4232_driver); + if (cs4232_devices) return 1; str = get_options(str, ARRAY_SIZE(ints), ints); -- cgit v1.2.3-59-g8ed1b From be54414d597b168d8c4eb2dafb8933ea15a7c148 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 27 Mar 2006 01:17:16 -0800 Subject: [PATCH] PNP: adjust pnp_register_card_driver() signature: sb_card Remove the assumption that pnp_register_card_driver() returns the number of devices claimed. And fix some __init/__devinit issues. Signed-off-by: Bjorn Helgaas Cc: Adam Belay Cc: Jaroslav Kysela Acked-by: Takashi Iwai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/sb_card.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c index 680b82e15298..d38e88abc8fa 100644 --- a/sound/oss/sb_card.c +++ b/sound/oss/sb_card.c @@ -52,6 +52,7 @@ static int __initdata sm_games = 0; /* Logitech soundman games? */ static struct sb_card_config *legacy = NULL; #ifdef CONFIG_PNP +static int pnp_registered; static int __initdata pnp = 1; /* static int __initdata uart401 = 0; @@ -133,7 +134,7 @@ static void sb_unload(struct sb_card_config *scc) } /* Register legacy card with OSS subsystem */ -static int sb_init_legacy(void) +static int __init sb_init_legacy(void) { struct sb_module_options sbmo = {0}; @@ -234,6 +235,8 @@ static void sb_dev2cfg(struct pnp_dev *dev, struct sb_card_config *scc) } } +static unsigned int sb_pnp_devices; + /* Probe callback function for the PnP API */ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device_id *card_id) { @@ -264,6 +267,7 @@ static int sb_pnp_probe(struct pnp_card_link *card, const struct pnp_card_device scc->conf.dma, scc->conf.dma2); pnp_set_card_drvdata(card, scc); + sb_pnp_devices++; return sb_register_oss(scc, &sbmo); } @@ -289,6 +293,14 @@ static struct pnp_card_driver sb_pnp_driver = { MODULE_DEVICE_TABLE(pnp_card, sb_pnp_card_table); #endif /* CONFIG_PNP */ +static void __init_or_module sb_unregister_all(void) +{ +#ifdef CONFIG_PNP + if (pnp_registered) + pnp_unregister_card_driver(&sb_pnp_driver); +#endif +} + static int __init sb_init(void) { int lres = 0; @@ -307,17 +319,18 @@ static int __init sb_init(void) #ifdef CONFIG_PNP if(pnp) { - pres = pnp_register_card_driver(&sb_pnp_driver); + int err = pnp_register_card_driver(&sb_pnp_driver); + if (!err) + pnp_registered = 1; + pres = sb_pnp_devices; } #endif printk(KERN_INFO "sb: Init: Done\n"); /* If either PnP or Legacy registered a card then return * success */ - if (pres <= 0 && lres <= 0) { -#ifdef CONFIG_PNP - pnp_unregister_card_driver(&sb_pnp_driver); -#endif + if (pres == 0 && lres <= 0) { + sb_unregister_all(); return -ENODEV; } return 0; @@ -333,9 +346,7 @@ static void __exit sb_exit(void) sb_unload(legacy); } -#ifdef CONFIG_PNP - pnp_unregister_card_driver(&sb_pnp_driver); -#endif + sb_unregister_all(); if (smw_free) { vfree(smw_free); -- cgit v1.2.3-59-g8ed1b From 910638ae7ed4be27d6af55f6c9b5bf54b838e78b Mon Sep 17 00:00:00 2001 From: Matthias Gehre Date: Tue, 28 Mar 2006 01:56:48 -0800 Subject: [PATCH] Replace 0xff.. with correct DMA_xBIT_MASK Replace all occurences of 0xff.. in calls to function pci_set_dma_mask() and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from linux/dma-mapping.h. Signed-off-by: Matthias Gehre Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/DMA-mapping.txt | 2 ++ drivers/atm/lanai.c | 2 +- drivers/block/umem.c | 5 +++-- drivers/net/forcedeth.c | 3 ++- drivers/net/ioc3-eth.c | 7 ++++--- drivers/net/ns83820.c | 6 +++--- drivers/net/wan/wanxl.c | 4 ++-- drivers/net/wireless/prism54/islpci_hotplug.c | 3 ++- drivers/scsi/BusLogic.c | 7 ++++--- drivers/scsi/a100u2w.c | 3 ++- drivers/scsi/aacraid/aachba.c | 1 + drivers/scsi/aacraid/linit.c | 5 +++-- drivers/scsi/atp870u.c | 3 ++- drivers/scsi/dpt_i2o.c | 5 +++-- drivers/scsi/eata.c | 3 ++- drivers/scsi/gdth.c | 7 ++++--- drivers/scsi/initio.c | 3 ++- drivers/scsi/ips.c | 5 +++-- drivers/scsi/megaraid.c | 7 ++++--- drivers/scsi/nsp32.c | 3 ++- drivers/scsi/qla1280.c | 5 +++-- drivers/scsi/qlogicfc.c | 5 +++-- include/linux/dma-mapping.h | 1 + sound/oss/esssolo1.c | 2 +- sound/oss/sonicvibes.c | 3 ++- sound/pci/ad1889.c | 1 + sound/pci/ali5451/ali5451.c | 5 +++-- sound/pci/als4000.c | 5 +++-- sound/pci/azt3328.c | 5 +++-- sound/pci/emu10k1/emu10k1x.c | 1 + sound/pci/es1938.c | 5 +++-- sound/pci/es1968.c | 1 + sound/pci/ice1712/ice1712.c | 2 ++ sound/pci/maestro3.c | 1 + sound/pci/mixart/mixart.c | 2 ++ sound/pci/pcxhr/pcxhr.c | 1 + sound/pci/sonicvibes.c | 5 +++-- sound/pci/trident/trident_main.c | 5 +++-- 38 files changed, 88 insertions(+), 51 deletions(-) (limited to 'sound/oss') diff --git a/Documentation/DMA-mapping.txt b/Documentation/DMA-mapping.txt index 684557474c15..ee4bb73683cd 100644 --- a/Documentation/DMA-mapping.txt +++ b/Documentation/DMA-mapping.txt @@ -199,6 +199,8 @@ address during PCI bus mastering you might do something like: "mydev: 24-bit DMA addressing not available.\n"); goto ignore_this_device; } +[Better use DMA_24BIT_MASK instead of 0x00ffffff. +See linux/include/dma-mapping.h for reference.] When pci_set_dma_mask() is successful, and returns zero, the PCI layer saves away this mask you have provided. The PCI layer will use this diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 69f4c7ce9a63..cac09e353be8 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1972,7 +1972,7 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai) "(itf %d): No suitable DMA available.\n", lanai->number); return -EBUSY; } - if (pci_set_consistent_dma_mask(pci, 0xFFFFFFFF) != 0) { + if (pci_set_consistent_dma_mask(pci, DMA_32BIT_MASK) != 0) { printk(KERN_WARNING DEV_LABEL "(itf %d): No suitable DMA available.\n", lanai->number); return -EBUSY; diff --git a/drivers/block/umem.c b/drivers/block/umem.c index c16e66b9c7a7..f7d4c65a7b8c 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -50,6 +50,7 @@ #include #include #include +#include #include /* O_ACCMODE */ #include /* HDIO_GETGEO */ @@ -881,8 +882,8 @@ static int __devinit mm_pci_probe(struct pci_dev *dev, const struct pci_device_i printk(KERN_INFO "Micro Memory(tm) controller #%d found at %02x:%02x (PCI Mem Module (Battery Backup))\n", card->card_number, dev->bus->number, dev->devfn); - if (pci_set_dma_mask(dev, 0xffffffffffffffffLL) && - pci_set_dma_mask(dev, 0xffffffffLL)) { + if (pci_set_dma_mask(dev, DMA_64BIT_MASK) && + pci_set_dma_mask(dev, DMA_32BIT_MASK)) { printk(KERN_WARNING "MM%d: NO suitable DMA found\n",num_cards); return -ENOMEM; } diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index e7fc28b07e5a..7627a75f4f7c 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -134,6 +134,7 @@ #include #include #include +#include #include #include @@ -2932,7 +2933,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i if (id->driver_data & DEV_HAS_HIGH_DMA) { /* packet format 3: supports 40-bit addressing */ np->desc_ver = DESC_VER_3; - if (pci_set_dma_mask(pci_dev, 0x0000007fffffffffULL)) { + if (pci_set_dma_mask(pci_dev, DMA_39BIT_MASK)) { printk(KERN_INFO "forcedeth: 64-bit DMA failed, using 32-bit addressing for device %s.\n", pci_name(pci_dev)); } else { diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index 9b8295ee06ef..ae71ed57c12d 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef CONFIG_SERIAL_8250 #include @@ -1195,17 +1196,17 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err, pci_using_dac; /* Configure DMA attributes. */ - err = pci_set_dma_mask(pdev, 0xffffffffffffffffULL); + err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); if (!err) { pci_using_dac = 1; - err = pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL); + err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); if (err < 0) { printk(KERN_ERR "%s: Unable to obtain 64 bit DMA " "for consistent allocations\n", pci_name(pdev)); goto out; } } else { - err = pci_set_dma_mask(pdev, 0xffffffffULL); + err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (err) { printk(KERN_ERR "%s: No usable DMA configuration, " "aborting.\n", pci_name(pdev)); diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 0fede50abd3e..8e9b1a537dee 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -1828,10 +1828,10 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ int using_dac = 0; /* See if we can set the dma mask early on; failure is fatal. */ - if (sizeof(dma_addr_t) == 8 && - !pci_set_dma_mask(pci_dev, 0xffffffffffffffffULL)) { + if (sizeof(dma_addr_t) == 8 && + !pci_set_dma_mask(pci_dev, DMA_64BIT_MASK)) { using_dac = 1; - } else if (!pci_set_dma_mask(pci_dev, 0xffffffff)) { + } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { using_dac = 0; } else { printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n"); diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 9d3b51c3ef54..29a756dd979b 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -577,8 +577,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev, We set both dma_mask and consistent_dma_mask to 28 bits and pray pci_alloc_consistent() will use this info. It should work on most platforms */ - if (pci_set_consistent_dma_mask(pdev, 0x0FFFFFFF) || - pci_set_dma_mask(pdev, 0x0FFFFFFF)) { + if (pci_set_consistent_dma_mask(pdev, DMA_28BIT_MASK) || + pci_set_dma_mask(pdev, DMA_28BIT_MASK)) { printk(KERN_ERR "wanXL: No usable DMA configuration\n"); return -EIO; } diff --git a/drivers/net/wireless/prism54/islpci_hotplug.c b/drivers/net/wireless/prism54/islpci_hotplug.c index b41d666fea3c..bfa0cc319a09 100644 --- a/drivers/net/wireless/prism54/islpci_hotplug.c +++ b/drivers/net/wireless/prism54/islpci_hotplug.c @@ -22,6 +22,7 @@ #include #include #include /* For __init, __exit */ +#include #include "prismcompat.h" #include "islpci_dev.h" @@ -124,7 +125,7 @@ prism54_probe(struct pci_dev *pdev, const struct pci_device_id *id) } /* enable PCI DMA */ - if (pci_set_dma_mask(pdev, 0xffffffff)) { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_ERR "%s: 32-bit PCI DMA not supported", DRV_NAME); goto do_pci_disable_device; } diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 5bf83cbca868..bde3d5834ade 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -677,7 +678,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK )) continue; Bus = PCI_Device->bus->number; @@ -832,7 +833,7 @@ static int __init BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK)) continue; Bus = PCI_Device->bus->number; @@ -886,7 +887,7 @@ static int __init BusLogic_InitializeFlashPointProbeInfo(struct BusLogic_HostAda if (pci_enable_device(PCI_Device)) continue; - if (pci_set_dma_mask(PCI_Device, (u64) 0xffffffff)) + if (pci_set_dma_mask(PCI_Device, DMA_32BIT_MASK)) continue; Bus = PCI_Device->bus->number; diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 9f45ae1745da..3dce21c78737 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -89,6 +89,7 @@ #include #include #include +#include #include #include @@ -1052,7 +1053,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev, if (pci_enable_device(pdev)) goto out; - if (pci_set_dma_mask(pdev, 0xffffffffULL)) { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "Unable to set 32bit DMA " "on inia100 adapter, ignoring.\n"); goto out_disable_device; diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index a16f8ded8f1d..8df4a0ea3761 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index c2596335549d..720330778648 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -806,8 +807,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, * to driver communication memory to be allocated below 2gig */ if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) - if (pci_set_dma_mask(pdev, 0x7FFFFFFFULL) || - pci_set_consistent_dma_mask(pdev, 0x7FFFFFFFULL)) + if (pci_set_dma_mask(pdev, DMA_31BIT_MASK) || + pci_set_consistent_dma_mask(pdev, DMA_31BIT_MASK)) goto out; pci_set_master(pdev); diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 5227a779c05c..a198d86667e9 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -2631,7 +2632,7 @@ static int atp870u_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_enable_device(pdev)) return -EIO; - if (!pci_set_dma_mask(pdev, 0xFFFFFFFFUL)) { + if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { printk(KERN_INFO "atp870u: use 32bit DMA mask.\n"); } else { printk(KERN_ERR "atp870u: DMA mask required but not available.\n"); diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 6e6b293dcb28..b1b704a42efd 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c @@ -57,6 +57,7 @@ MODULE_DESCRIPTION("Adaptec I2O RAID Driver"); #include #include #include +#include #include #include @@ -906,8 +907,8 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev } pci_set_master(pDev); - if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && - pci_set_dma_mask(pDev, 0xffffffffULL)) + if (pci_set_dma_mask(pDev, DMA_64BIT_MASK) && + pci_set_dma_mask(pDev, DMA_32BIT_MASK)) return -EINVAL; base_addr0_phys = pci_resource_start(pDev,0); diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index b3f9de8f7595..059eeee4b554 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -490,6 +490,7 @@ #include #include #include +#include #include #include #include @@ -1426,7 +1427,7 @@ static int port_detect(unsigned long port_base, unsigned int j, if (ha->pdev) { pci_set_master(ha->pdev); - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) printk("%s: warning, pci_set_dma_mask failed.\n", ha->board_name); } diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 7f7013e80a88..d5740bbdef3e 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -388,6 +388,7 @@ #include #include #include +#include #ifdef GDTH_RTC #include #endif @@ -4527,15 +4528,15 @@ static int __init gdth_detect(struct scsi_host_template *shtp) if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| /* 64-bit DMA only supported from FW >= x.43 */ (!ha->dma64_support)) { - if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { + if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "GDT-PCI %d: Unable to set 32-bit DMA\n", hanum); err = TRUE; } } else { shp->max_cmd_len = 16; - if (!pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffffffffffffULL)) { + if (!pci_set_dma_mask(pcistr[ctr].pdev, DMA_64BIT_MASK)) { printk("GDT-PCI %d: 64-bit DMA enabled\n", hanum); - } else if (pci_set_dma_mask(pcistr[ctr].pdev, 0xffffffff)) { + } else if (pci_set_dma_mask(pcistr[ctr].pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "GDT-PCI %d: Unable to set 64/32-bit DMA\n", hanum); err = TRUE; } diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index ea6f3c0e05d9..0cc7f65b584f 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -127,6 +127,7 @@ #include #include #include +#include #include #include @@ -2780,7 +2781,7 @@ static int tul_NewReturnNumberOfAdapters(void) if (((dRegValue & 0xFF00) >> 8) == 0xFF) dRegValue = 0; wBIOS = (wBIOS << 8) + ((UWORD) ((dRegValue & 0xFF00) >> 8)); - if (pci_set_dma_mask(pDev, 0xffffffff)) { + if (pci_set_dma_mask(pDev, DMA_32BIT_MASK)) { printk(KERN_WARNING "i91u: Could not set 32 bit DMA mask\n"); continue; diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 481708d527ae..a4c0b04cfdbd 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -179,6 +179,7 @@ #include #include +#include #include @@ -7284,10 +7285,10 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) * are guaranteed to be < 4G. */ if (IPS_ENABLE_DMA64 && IPS_HAS_ENH_SGLIST(ha) && - !pci_set_dma_mask(ha->pcidev, 0xffffffffffffffffULL)) { + !pci_set_dma_mask(ha->pcidev, DMA_64BIT_MASK)) { (ha)->flags |= IPS_HA_ENH_SG; } else { - if (pci_set_dma_mask(ha->pcidev, 0xffffffffULL) != 0) { + if (pci_set_dma_mask(ha->pcidev, DMA_32BIT_MASK) != 0) { printk(KERN_WARNING "Unable to set DMA Mask\n"); return ips_abort_init(ha, index); } diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 7144674bc8e6..80b68a2481b3 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include "scsi.h" @@ -2094,7 +2095,7 @@ make_local_pdev(adapter_t *adapter, struct pci_dev **pdev) memcpy(*pdev, adapter->dev, sizeof(struct pci_dev)); - if( pci_set_dma_mask(*pdev, 0xffffffff) != 0 ) { + if( pci_set_dma_mask(*pdev, DMA_32BIT_MASK) != 0 ) { kfree(*pdev); return -1; } @@ -4859,10 +4860,10 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Set the Mode of addressing to 64 bit if we can */ if ((adapter->flag & BOARD_64BIT) && (sizeof(dma_addr_t) == 8)) { - pci_set_dma_mask(pdev, 0xffffffffffffffffULL); + pci_set_dma_mask(pdev, DMA_64BIT_MASK); adapter->has_64bit_addr = 1; } else { - pci_set_dma_mask(pdev, 0xffffffff); + pci_set_dma_mask(pdev, DMA_32BIT_MASK); adapter->has_64bit_addr = 0; } diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index a279ebb61447..30ee0ef4b459 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -2776,7 +2777,7 @@ static int nsp32_detect(struct scsi_host_template *sht) /* * setup DMA */ - if (pci_set_dma_mask(PCIDEV, 0xffffffffUL) != 0) { + if (pci_set_dma_mask(PCIDEV, DMA_32BIT_MASK) != 0) { nsp32_msg (KERN_ERR, "failed to set PCI DMA mask"); goto scsi_unregister; } diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index e0230249fa0f..5a48e55f9418 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -350,6 +350,7 @@ #include #include #include +#include #include #include @@ -4321,7 +4322,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) #ifdef QLA_64BIT_PTR if (pci_set_dma_mask(ha->pdev, (dma_addr_t) ~ 0ULL)) { - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n", ha->host_no); error = -ENODEV; @@ -4331,7 +4332,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n", ha->host_no); #else - if (pci_set_dma_mask(ha->pdev, 0xffffffff)) { + if (pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK)) { printk(KERN_WARNING "scsi(%li): Unable to set a " "suitable DMA mask - aborting\n", ha->host_no); error = -ENODEV; diff --git a/drivers/scsi/qlogicfc.c b/drivers/scsi/qlogicfc.c index 5b15998c71a6..52b224a5d6fd 100644 --- a/drivers/scsi/qlogicfc.c +++ b/drivers/scsi/qlogicfc.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -738,8 +739,8 @@ static int isp2x00_detect(struct scsi_host_template * tmpt) continue; /* Try to configure DMA attributes. */ - if (pci_set_dma_mask(pdev, 0xffffffffffffffffULL) && - pci_set_dma_mask(pdev, 0xffffffffULL)) + if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) && + pci_set_dma_mask(pdev, DMA_32BIT_MASK)) continue; host = scsi_register(tmpt, sizeof(struct isp2x00_hostdata)); diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index a8731062a74c..9b4751aecc23 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -21,6 +21,7 @@ enum dma_data_direction { #define DMA_30BIT_MASK 0x000000003fffffffULL #define DMA_29BIT_MASK 0x000000001fffffffULL #define DMA_28BIT_MASK 0x000000000fffffffULL +#define DMA_24BIT_MASK 0x0000000000ffffffULL #include diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c index 78d3e29ce968..6861563d7525 100644 --- a/sound/oss/esssolo1.c +++ b/sound/oss/esssolo1.c @@ -2348,7 +2348,7 @@ static int __devinit solo1_probe(struct pci_dev *pcidev, const struct pci_device /* Recording requires 24-bit DMA, so attempt to set dma mask * to 24 bits first, then 32 bits (playback only) if that fails. */ - if (pci_set_dma_mask(pcidev, 0x00ffffff) && + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK) && pci_set_dma_mask(pcidev, DMA_32BIT_MASK)) { printk(KERN_WARNING "solo1: architecture does not support 24bit or 32bit PCI busmaster DMA\n"); return -ENODEV; diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index 4471757b7985..42bd276cfc39 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -116,6 +116,7 @@ #include #include #include +#include #include @@ -2535,7 +2536,7 @@ static int __devinit sv_probe(struct pci_dev *pcidev, const struct pci_device_id return -ENODEV; if (pcidev->irq == 0) return -ENODEV; - if (pci_set_dma_mask(pcidev, 0x00ffffff)) { + if (pci_set_dma_mask(pcidev, DMA_24BIT_MASK)) { printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n"); return -ENODEV; } diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index 2aa5a7fdb6e0..c6c8333acc62 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index e264136e8fb4..fc92b6896c24 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -2220,8 +2221,8 @@ static int __devinit snd_ali_create(struct snd_card *card, if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 31 bits */ - if (pci_set_dma_mask(pci, 0x7fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_31BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_31BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 31bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c index 7b2ff5f4672e..100d8127a411 100644 --- a/sound/pci/als4000.c +++ b/sound/pci/als4000.c @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -688,8 +689,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci, return err; } /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index e077eb3fbe2f..680077e1e057 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -104,6 +104,7 @@ #include #include #include +#include #include #include #include @@ -1669,8 +1670,8 @@ snd_azf3328_create(struct snd_card *card, chip->irq = -1; /* check if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); err = -ENXIO; goto out_err; diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 2208dbd48be9..3e332f398162 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 0d556b09ad04..4d62fe439177 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -1517,8 +1518,8 @@ static int __devinit snd_es1938_create(struct snd_card *card, if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index dd465a186e11..e3ad17f53c29 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -104,6 +104,7 @@ #include #include #include +#include #include #include diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 672e198317e1..b88eeba2f5d1 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -56,7 +56,9 @@ #include #include #include +#include #include + #include #include #include diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 8bc084956c28..44393e190929 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 43ee3b2b948f..b5a095052d4c 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -28,6 +28,8 @@ #include #include #include +#include + #include #include #include diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index f679779d96e3..35875c8aa299 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index 7bbea3738b8a..2d66a09fe5ee 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1227,8 +1228,8 @@ static int __devinit snd_sonicvibes_create(struct snd_card *card, if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 24 bits */ - if (pci_set_dma_mask(pci, 0x00ffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x00ffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_24BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_24BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 24bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 83b7d8aba9e6..52178b8ad49d 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -3554,8 +3555,8 @@ int __devinit snd_trident_create(struct snd_card *card, if ((err = pci_enable_device(pci)) < 0) return err; /* check, if we can restrict PCI DMA transfers to 30 bits */ - if (pci_set_dma_mask(pci, 0x3fffffff) < 0 || - pci_set_consistent_dma_mask(pci, 0x3fffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_30BIT_MASK) < 0 || + pci_set_consistent_dma_mask(pci, DMA_30BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 30bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; -- cgit v1.2.3-59-g8ed1b From 457d3d432bede99ed04d3bdeb5efb238a3627e8f Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 28 Mar 2006 01:56:49 -0800 Subject: [PATCH] vfree NULL check fixup for sb_card There's no need to check the vfree() argument for NULL. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/sb_card.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/sb_card.c b/sound/oss/sb_card.c index d38e88abc8fa..4708cbdc3149 100644 --- a/sound/oss/sb_card.c +++ b/sound/oss/sb_card.c @@ -348,10 +348,8 @@ static void __exit sb_exit(void) sb_unregister_all(); - if (smw_free) { - vfree(smw_free); - smw_free = NULL; - } + vfree(smw_free); + smw_free = NULL; } module_init(sb_init); -- cgit v1.2.3-59-g8ed1b From 07e0e93d9a3cdbe3cad450e0d0a2937585dffc55 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 28 Mar 2006 01:56:49 -0800 Subject: [PATCH] maestro3 vfree NULL check fixup vfree() checks for NULL, no need to do it explicitly. Signed-off-by: Jesper Juhl Acked-by: Zach Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/maestro3.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/maestro3.c b/sound/oss/maestro3.c index 66044aff2586..4a5e4237a110 100644 --- a/sound/oss/maestro3.c +++ b/sound/oss/maestro3.c @@ -2582,15 +2582,9 @@ static int alloc_dsp_suspendmem(struct m3_card *card) return 0; } -static void free_dsp_suspendmem(struct m3_card *card) -{ - if(card->suspend_mem) - vfree(card->suspend_mem); -} #else #define alloc_dsp_suspendmem(args...) 0 -#define free_dsp_suspendmem(args...) #endif /* @@ -2717,7 +2711,7 @@ out: if(ret) { if(card->iobase) release_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0)); - free_dsp_suspendmem(card); + vfree(card->suspend_mem); if(card->ac97) { unregister_sound_mixer(card->ac97->dev_mixer); kfree(card->ac97); @@ -2760,7 +2754,7 @@ static void m3_remove(struct pci_dev *pci_dev) } release_region(card->iobase, 256); - free_dsp_suspendmem(card); + vfree(card->suspend_mem); kfree(card); } devs = NULL; -- cgit v1.2.3-59-g8ed1b From 5a83fdddb8a104c021837637a59f93948b906819 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 28 Mar 2006 01:56:50 -0800 Subject: [PATCH] no need to check vfree arg for null in oss/sequencer There's no need to check pointers for NULL before handing them to vfree(). Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/sequencer.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c index 347cd79c2502..6815c30e0bc1 100644 --- a/sound/oss/sequencer.c +++ b/sound/oss/sequencer.c @@ -1671,14 +1671,7 @@ void sequencer_init(void) void sequencer_unload(void) { - if(queue) - { - vfree(queue); - queue=NULL; - } - if(iqueue) - { - vfree(iqueue); - iqueue=NULL; - } + vfree(queue); + vfree(iqueue); + queue = iqueue = NULL; } -- cgit v1.2.3-59-g8ed1b From ca43b317fc557bbcca845c684d93375286bf9e0b Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 28 Mar 2006 01:56:51 -0800 Subject: [PATCH] vfree does its own NULL check, no need to be explicit in oss/msnd.c vfree() does it's own NULL checking, no need for explicit check before calling it. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/oss/msnd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sound/oss') diff --git a/sound/oss/msnd.c b/sound/oss/msnd.c index a7ad2b0a2ac0..5dbfc0f9c3c7 100644 --- a/sound/oss/msnd.c +++ b/sound/oss/msnd.c @@ -95,10 +95,8 @@ void msnd_fifo_init(msnd_fifo *f) void msnd_fifo_free(msnd_fifo *f) { - if (f->data) { - vfree(f->data); - f->data = NULL; - } + vfree(f->data); + f->data = NULL; } int msnd_fifo_alloc(msnd_fifo *f, size_t n) -- cgit v1.2.3-59-g8ed1b From 4fa95ef639830ccf0ca1ad42ee9bed87ef642f32 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Tue, 28 Mar 2006 01:56:54 -0800 Subject: [PATCH] sound: Remove unneeded kmalloc() return value casts Get rid of unnessesary casts of kmalloc() return value in sound/ Signed-off-by: Jesper Juhl Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/core/rawmidi.c | 6 ++++-- sound/oss/dmasound/dmasound_awacs.c | 2 +- sound/oss/emu10k1/midi.c | 9 ++++++--- sound/oss/sh_dac_audio.c | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) (limited to 'sound/oss') diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 6b7a36774298..87b47c9564f7 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -631,7 +631,8 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, return -EINVAL; } if (params->buffer_size != runtime->buffer_size) { - if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL) + newbuf = kmalloc(params->buffer_size, GFP_KERNEL); + if (!newbuf) return -ENOMEM; kfree(runtime->buffer); runtime->buffer = newbuf; @@ -657,7 +658,8 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, return -EINVAL; } if (params->buffer_size != runtime->buffer_size) { - if ((newbuf = (char *) kmalloc(params->buffer_size, GFP_KERNEL)) == NULL) + newbuf = kmalloc(params->buffer_size, GFP_KERNEL); + if (!newbuf) return -ENOMEM; kfree(runtime->buffer); runtime->buffer = newbuf; diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index 6ba8d6f45fe8..3bbc8105e9f1 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -2798,7 +2798,7 @@ __init setup_beep(void) DBDMA_ALIGN(beep_dbdma_cmd_space); /* set up emergency dbdma cmd */ emergency_dbdma_cmd = beep_dbdma_cmd+1 ; - beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); + beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); if (beep_buf == NULL) { printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n"); kfree(beep_dbdma_cmd_space) ; diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c index 959a96794dba..25ae8e4a488d 100644 --- a/sound/oss/emu10k1/midi.c +++ b/sound/oss/emu10k1/midi.c @@ -65,7 +65,8 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd init_midi_hdr(midihdr); - if ((midihdr->data = (u8 *) kmalloc(MIDIIN_BUFLEN, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(MIDIIN_BUFLEN, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -1; @@ -334,7 +335,8 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, midihdr->bytesrecorded = 0; midihdr->flags = 0; - if ((midihdr->data = (u8 *) kmalloc(count, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(count, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -EINVAL; @@ -545,7 +547,8 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) midihdr->bytesrecorded = 0; midihdr->flags = 0; - if ((midihdr->data = (u8 *) kmalloc(1, GFP_KERNEL)) == NULL) { + midihdr->data = kmalloc(1, GFP_KERNEL); + if (!midihdr->data) { ERROR(); kfree(midihdr); return -EINVAL; diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index 8a9917c919c2..3f7427cd195a 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c @@ -289,7 +289,7 @@ static int __init dac_audio_init(void) in_use = 0; - data_buffer = (char *)kmalloc(BUFFER_SIZE, GFP_KERNEL); + data_buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL); if (data_buffer == NULL) return -ENOMEM; -- cgit v1.2.3-59-g8ed1b