printf: Remove some L modifier uses
[coreboot.git] / src / devices / pnp_device.c
index 702aa9253c3a15fc0b26dcec57bea102df855ef2..fb6c9d68685b55d109e5155f0831346bbf0eaa30 100644 (file)
@@ -107,7 +107,7 @@ void pnp_read_resources(device_t dev)
 static void pnp_set_resource(device_t dev, struct resource *resource)
 {
        if (!(resource->flags & IORESOURCE_ASSIGNED)) {
-               printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010Lx "
+               printk(BIOS_ERR, "ERROR: %s %02lx %s size: 0x%010llx "
                       "not assigned\n", dev_path(dev), resource->index,
                       resource_type(resource), resource->size);
                return;
@@ -163,13 +163,19 @@ struct device_operations pnp_ops = {
        .enable           = pnp_enable,
 };
 
-/* PNP chip opertations */
+/* PNP chip operations */
 
 static void pnp_get_ioresource(device_t dev, u8 index, struct io_info *info)
 {
        struct resource *resource;
        unsigned moving, gran, step;
 
+       if (!info->mask) {
+               printk(BIOS_ERR, "ERROR: device %s index %d has no mask.\n",
+                               dev_path(dev), index);
+               return;
+       }
+
        resource = new_resource(dev, index);
 
        /* Initilize the resource. */
@@ -214,18 +220,15 @@ static void get_resources(device_t dev, struct pnp_info *info)
 {
        struct resource *resource;
 
-       if (info->flags & PNP_IO0) {
+       if (info->flags & PNP_IO0)
                pnp_get_ioresource(dev, PNP_IDX_IO0, &info->io0);
-       }
-       if (info->flags & PNP_IO1) {
+       if (info->flags & PNP_IO1)
                pnp_get_ioresource(dev, PNP_IDX_IO1, &info->io1);
-       }
-       if (info->flags & PNP_IO2) {
+       if (info->flags & PNP_IO2)
                pnp_get_ioresource(dev, PNP_IDX_IO2, &info->io2);
-       }
-       if (info->flags & PNP_IO3) {
+       if (info->flags & PNP_IO3)
                pnp_get_ioresource(dev, PNP_IDX_IO3, &info->io3);
-       }
+
        if (info->flags & PNP_IRQ0) {
                resource = new_resource(dev, PNP_IDX_IRQ0);
                resource->size = 1;
@@ -236,6 +239,7 @@ static void get_resources(device_t dev, struct pnp_info *info)
                resource->size = 1;
                resource->flags |= IORESOURCE_IRQ;
        }
+
        if (info->flags & PNP_DRQ0) {
                resource = new_resource(dev, PNP_IDX_DRQ0);
                resource->size = 1;