Please bear with me - another rename checkin. This qualifies as trivial, no
[coreboot.git] / src / devices / pnp_device.c
index 13f12ee4e48cc44fa733a83c0894b0ef430a0b01..b5d8f9716fb7a9785bf60638c5ed9624e78d78fb 100644 (file)
@@ -1,5 +1,25 @@
-/* Copyright 2004 Linux Networx  */
-/* This code is distrubted wihtout warrant under the GPL v2 (see COPYING) */
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2004 Linux Networx
+ * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx)
+ * Copyright (C) 2004 Li-Ta Lo <ollie@lanl.gov>
+ * Copyright (C) 2005 Tyan
+ * (Written by Yinghai Lu <yhlu@tyan.com> for Tyan)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
 
 #include <console/console.h>
 #include <stdlib.h>
@@ -52,7 +72,7 @@ void pnp_set_irq(device_t dev, unsigned index, unsigned irq)
        pnp_write_config(dev, index, irq);
 }
 
-void pnp_set_drq(device_t dev, unsigned drq, unsigned index)
+void pnp_set_drq(device_t dev, unsigned index, unsigned drq)
 {
        /* Index == 0x74 */
        pnp_write_config(dev, index, drq & 0xff);
@@ -220,6 +240,10 @@ void pnp_enable_devices(device_t base_dev, struct device_operations *ops,
        
        /* Setup the ops and resources on the newly allocated devices */
        for(i = 0; i < functions; i++) {
+               /* Skip logical devices this Super I/O doesn't have. */
+               if (info[i].function == -1)
+                       continue;
+
                path.u.pnp.device = info[i].function;
                dev = alloc_find_dev(base_dev->bus, &path);