aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/macio_asic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/macio_asic.c')
-rw-r--r--drivers/macintosh/macio_asic.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 17d3bc917562..3543a82081de 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -190,11 +190,11 @@ static int macio_resource_quirks(struct device_node *np, struct resource *res,
190 return 0; 190 return 0;
191 191
192 /* Grand Central has too large resource 0 on some machines */ 192 /* Grand Central has too large resource 0 on some machines */
193 if (index == 0 && !strcmp(np->name, "gc")) 193 if (index == 0 && of_node_name_eq(np, "gc"))
194 res->end = res->start + 0x1ffff; 194 res->end = res->start + 0x1ffff;
195 195
196 /* Airport has bogus resource 2 */ 196 /* Airport has bogus resource 2 */
197 if (index >= 2 && !strcmp(np->name, "radio")) 197 if (index >= 2 && of_node_name_eq(np, "radio"))
198 return 1; 198 return 1;
199 199
200#ifndef CONFIG_PPC64 200#ifndef CONFIG_PPC64
@@ -207,21 +207,21 @@ static int macio_resource_quirks(struct device_node *np, struct resource *res,
207 * level of hierarchy, but I don't really feel the need 207 * level of hierarchy, but I don't really feel the need
208 * for it 208 * for it
209 */ 209 */
210 if (!strcmp(np->name, "escc")) 210 if (of_node_name_eq(np, "escc"))
211 return 1; 211 return 1;
212 212
213 /* ESCC has bogus resources >= 3 */ 213 /* ESCC has bogus resources >= 3 */
214 if (index >= 3 && !(strcmp(np->name, "ch-a") && 214 if (index >= 3 && (of_node_name_eq(np, "ch-a") ||
215 strcmp(np->name, "ch-b"))) 215 of_node_name_eq(np, "ch-b")))
216 return 1; 216 return 1;
217 217
218 /* Media bay has too many resources, keep only first one */ 218 /* Media bay has too many resources, keep only first one */
219 if (index > 0 && !strcmp(np->name, "media-bay")) 219 if (index > 0 && of_node_name_eq(np, "media-bay"))
220 return 1; 220 return 1;
221 221
222 /* Some older IDE resources have bogus sizes */ 222 /* Some older IDE resources have bogus sizes */
223 if (!(strcmp(np->name, "IDE") && strcmp(np->name, "ATA") && 223 if (of_node_name_eq(np, "IDE") || of_node_name_eq(np, "ATA") ||
224 strcmp(np->type, "ide") && strcmp(np->type, "ata"))) { 224 of_node_is_type(np, "ide") || of_node_is_type(np, "ata")) {
225 if (index == 0 && (res->end - res->start) > 0xfff) 225 if (index == 0 && (res->end - res->start) > 0xfff)
226 res->end = res->start + 0xfff; 226 res->end = res->start + 0xfff;
227 if (index == 1 && (res->end - res->start) > 0xff) 227 if (index == 1 && (res->end - res->start) > 0xff)
@@ -260,7 +260,7 @@ static void macio_add_missing_resources(struct macio_dev *dev)
260 irq_base = 64; 260 irq_base = 64;
261 261
262 /* Fix SCC */ 262 /* Fix SCC */
263 if (strcmp(np->name, "ch-a") == 0) { 263 if (of_node_name_eq(np, "ch-a")) {
264 macio_create_fixup_irq(dev, 0, 15 + irq_base); 264 macio_create_fixup_irq(dev, 0, 15 + irq_base);
265 macio_create_fixup_irq(dev, 1, 4 + irq_base); 265 macio_create_fixup_irq(dev, 1, 4 + irq_base);
266 macio_create_fixup_irq(dev, 2, 5 + irq_base); 266 macio_create_fixup_irq(dev, 2, 5 + irq_base);
@@ -268,18 +268,18 @@ static void macio_add_missing_resources(struct macio_dev *dev)
268 } 268 }
269 269
270 /* Fix media-bay */ 270 /* Fix media-bay */
271 if (strcmp(np->name, "media-bay") == 0) { 271 if (of_node_name_eq(np, "media-bay")) {
272 macio_create_fixup_irq(dev, 0, 29 + irq_base); 272 macio_create_fixup_irq(dev, 0, 29 + irq_base);
273 printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n"); 273 printk(KERN_INFO "macio: fixed media-bay irq on gatwick\n");
274 } 274 }
275 275
276 /* Fix left media bay childs */ 276 /* Fix left media bay childs */
277 if (dev->media_bay != NULL && strcmp(np->name, "floppy") == 0) { 277 if (dev->media_bay != NULL && of_node_name_eq(np, "floppy")) {
278 macio_create_fixup_irq(dev, 0, 19 + irq_base); 278 macio_create_fixup_irq(dev, 0, 19 + irq_base);
279 macio_create_fixup_irq(dev, 1, 1 + irq_base); 279 macio_create_fixup_irq(dev, 1, 1 + irq_base);
280 printk(KERN_INFO "macio: fixed left floppy irqs\n"); 280 printk(KERN_INFO "macio: fixed left floppy irqs\n");
281 } 281 }
282 if (dev->media_bay != NULL && strcasecmp(np->name, "ata4") == 0) { 282 if (dev->media_bay != NULL && of_node_name_eq(np, "ata4")) {
283 macio_create_fixup_irq(dev, 0, 14 + irq_base); 283 macio_create_fixup_irq(dev, 0, 14 + irq_base);
284 macio_create_fixup_irq(dev, 0, 3 + irq_base); 284 macio_create_fixup_irq(dev, 0, 3 + irq_base);
285 printk(KERN_INFO "macio: fixed left ide irqs\n"); 285 printk(KERN_INFO "macio: fixed left ide irqs\n");
@@ -438,11 +438,8 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
438 438
439static int macio_skip_device(struct device_node *np) 439static int macio_skip_device(struct device_node *np)
440{ 440{
441 if (strncmp(np->name, "battery", 7) == 0) 441 return of_node_name_prefix(np, "battery") ||
442 return 1; 442 of_node_name_prefix(np, "escc-legacy");
443 if (strncmp(np->name, "escc-legacy", 11) == 0)
444 return 1;
445 return 0;
446} 443}
447 444
448/** 445/**
@@ -489,9 +486,9 @@ static void macio_pci_add_devices(struct macio_chip *chip)
489 root_res); 486 root_res);
490 if (mdev == NULL) 487 if (mdev == NULL)
491 of_node_put(np); 488 of_node_put(np);
492 else if (strncmp(np->name, "media-bay", 9) == 0) 489 else if (of_node_name_prefix(np, "media-bay"))
493 mbdev = mdev; 490 mbdev = mdev;
494 else if (strncmp(np->name, "escc", 4) == 0) 491 else if (of_node_name_prefix(np, "escc"))
495 sdev = mdev; 492 sdev = mdev;
496 } 493 }
497 494