linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: JosephChan@via.com.tw, akpm@linux-foundation.org,
	geert@linux-m68k.org, linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [Linux-fbdev-devel] [PATCH 3/9] viafb: VIA Frame Buffer Device Driver
Date: Wed, 7 May 2008 16:28:20 +0100	[thread overview]
Message-ID: <20080507162820.4ecd1b55@core> (raw)
In-Reply-To: <C80EF34A3D2E494DBAF9AC29C7AE4EB806F67754@exchtp03.taipei.via.com.tw>

> +	/* Indentify GFX Chip Name */
> +	pdev =
> +	    (struct pci_dev *)pci_get_device(PCI_VIA_VENDOR_ID,
> +					     UNICHROME_CLE266_DID, NULL);
> +	if (pdev != NULL)
> +		chip_info.gfx_chip_name = UNICHROME_CLE266;
> +
> +	pdev =
> +	    (struct pci_dev *)pci_get_device(PCI_VIA_VENDOR_ID,
> +					     UNICHROME_K400_DID, NULL);

pci_get_device takes a reference so you need to do a pci_dev_put() on the
result if you have finished with it. Alternatively you could make use of
pci_dev_present()

> +	case UNICHROME_CLE266:
> +		pdev =
> +		    (struct pci_dev *)pci_get_device(PCI_VIA_VENDOR_ID,
> +						     UNICHROME_CLE266_DID,

Similar issue here.


> +void get_fb_info(unsigned int *fb_base, unsigned int *fb_len)
> +{
> +	struct pci_dev *pdev = NULL;
> +
> +	switch (chip_info.gfx_chip_name) {
> +	case UNICHROME_CLE266:
> +		pdev =
> +		    (struct pci_dev *)pci_get_device(PCI_VIA_VENDOR_ID,
> +						     UNICHROME_CLE266_DID,
> +						     NULL);

And here

So it might be better to for example use an array of types and keep the
array reference in the probe function pci_device_id field (which is how a
lot of stuff like libata drivers avoid doing messy lookups)

      reply	other threads:[~2008-05-07 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 11:09 [PATCH 3/9] viafb: VIA Frame Buffer Device Driver JosephChan
2008-05-07 15:28 ` Alan Cox [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080507162820.4ecd1b55@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=JosephChan@via.com.tw \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).