From aca48868516dca92b7bf20e0023f027c933db4f1 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 4 Apr 2010 01:12:50 -0700 Subject: [PATCH] --- yaml --- r: 189443 b: refs/heads/master c: bdd32ce95f79fb5cc964cd789d7ae4500bba7c6f h: refs/heads/master i: 189441: c04378dd910a5ba9890a8b89e20b86329c194f91 189439: 0cbc7720731bb79fb60b9b8b5ddc7e7787ac988b v: v3 --- [refs] | 2 +- trunk/drivers/video/sunxvr500.c | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index df8eae4c8123..472b366a18a7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 954fbc8985328a3b59b5881243d3aa04a8f8da7c +refs/heads/master: bdd32ce95f79fb5cc964cd789d7ae4500bba7c6f diff --git a/trunk/drivers/video/sunxvr500.c b/trunk/drivers/video/sunxvr500.c index 4cd50497264d..3803745d6eee 100644 --- a/trunk/drivers/video/sunxvr500.c +++ b/trunk/drivers/video/sunxvr500.c @@ -242,11 +242,27 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep) static int __devinit e3d_pci_register(struct pci_dev *pdev, const struct pci_device_id *ent) { + struct device_node *of_node; + const char *device_type; struct fb_info *info; struct e3d_info *ep; unsigned int line_length; int err; + of_node = pci_device_to_OF_node(pdev); + if (!of_node) { + printk(KERN_ERR "e3d: Cannot find OF node of %s\n", + pci_name(pdev)); + return -ENODEV; + } + + device_type = of_get_property(of_node, "device_type", NULL); + if (!device_type) { + printk(KERN_INFO "e3d: Ignoring secondary output device " + "at %s\n", pci_name(pdev)); + return -ENODEV; + } + err = pci_enable_device(pdev); if (err < 0) { printk(KERN_ERR "e3d: Cannot enable PCI device %s\n", @@ -265,13 +281,7 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev, ep->info = info; ep->pdev = pdev; spin_lock_init(&ep->lock); - ep->of_node = pci_device_to_OF_node(pdev); - if (!ep->of_node) { - printk(KERN_ERR "e3d: Cannot find OF node of %s\n", - pci_name(pdev)); - err = -ENODEV; - goto err_release_fb; - } + ep->of_node = of_node; /* Read the PCI base register of the frame buffer, which we * need in order to interpret the RAMDAC_VID_*FB* values in