Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 5 Dec 2000 02:44:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 5 Dec 2000 02:44:44 -0500 Received: from wire.cadcamlab.org ([156.26.20.181]:60946 "EHLO wire.cadcamlab.org") by vger.kernel.org with ESMTP id ; Tue, 5 Dec 2000 02:44:26 -0500 From: Peter Samuelson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14892.38320.194351.163997@wire.cadcamlab.org> Date: Tue, 5 Dec 2000 01:13:52 -0600 (CST) To: adam@yggdrasil.com CC: torvalds@transmeta.com, linux-kernel@vger.kernel.org Subject: [PATCH] ymfpci.c MODULE_DEVICE_TABLE X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid X-Face: ?*2Jm8R'OlE|+C~V>u$CARJyKMOpJ"^kNhLusXnPTFBF!#8,jH/#=Iy(?ehN$jH }x;J6B@[z.Ad\Be5RfNB*1>Eh.'R%u2gRj)M4blT]vu%^Qqreg_lock); spin_lock_init(&codec->voice_lock); codec->pci = pcidev; - codec->inst = instance; + codec->inst = ymf_instance; codec->irq = pcidev->irq; codec->device_id = pcidev->device; pci_read_config_byte(pcidev, PCI_REVISION_ID, (u8 *)&codec->rev); @@ -2270,8 +2274,8 @@ pci_set_master(pcidev); /* XXX KERN_INFO */ - printk("ymfpci%d: %s at 0x%lx IRQ %d\n", instance, - ymf_devv[devx].name, codec->reg_area_phys, codec->irq); + printk("ymfpci%d: %s at 0x%lx IRQ %d\n", ymf_instance, + (char *)ent->driver_data, codec->reg_area_phys, codec->irq); ymfpci_aclink_reset(pcidev); if (ymfpci_codec_ready(codec, 0, 1) < 0) { @@ -2317,6 +2321,7 @@ codec->next = ymf_devs; ymf_devs = codec; + ymf_instance++; return 0; } @@ -2356,43 +2361,15 @@ MODULE_AUTHOR("Jaroslav Kysela"); MODULE_DESCRIPTION("Yamaha YMF7xx PCI Audio"); -static int /* __init */ -ymf_probe(void) -{ - struct pci_dev *pcidev; - int foundone; - int i; - - if (!pci_present()) - return -ENODEV; - - /* - * Print our proud ego-nursing "Hello, World!" message as in MS-DOS. - */ - /* printk(KERN_INFO "ymfpci: Yamaha YMF7xx\n"); */ - - /* - * Not very efficient, but Alan did it so in cs46xx.c. - */ - foundone = 0; - pcidev = NULL; - for (i = 0; i < sizeof(ymf_devv)/sizeof(ymf_devv[0]); i++) { - while ((pcidev = pci_find_device(PCI_VENDOR_ID_YAMAHA, - ymf_devv[i].id, pcidev)) != NULL) { - if (ymf_install(pcidev, foundone, i) == 0) { - foundone++; - } - } - } - - return foundone; -} +static struct pci_driver ymfpci_driver = { + name: "ymfpci", + id_table: ymf_id_tbl, + probe: ymf_install_one, +}; static int ymf_init_module(void) { - if (ymf_probe()==0) - printk(KERN_ERR "ymfpci: No devices found.\n"); - return 0; + return pci_module_init (&ymfpci_driver); } static void ymf_cleanup_module (void) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/