From patchwork Fri Jul 22 18:16:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 1000322 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6MIHuOw022402 for ; Fri, 22 Jul 2011 18:17:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754699Ab1GVSRy (ORCPT ); Fri, 22 Jul 2011 14:17:54 -0400 Received: from mail.dev.rtsoft.ru ([213.79.90.226]:38454 "HELO mail.dev.rtsoft.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754674Ab1GVSRy (ORCPT ); Fri, 22 Jul 2011 14:17:54 -0400 Received: (qmail 9785 invoked from network); 22 Jul 2011 18:17:55 -0000 Received: from unknown (HELO wasted.dev.rtsoft.ru) (192.168.1.70) by 0 with SMTP; 22 Jul 2011 18:17:55 -0000 To: linux-media@vger.kernel.org, mchehab@infradead.org Subject: [PATCH] bt8xx: use pci_dev->subsystem_{vendor|device} Content-Disposition: inline From: Sergei Shtylyov Organization: MontaVista Software Inc. Date: Fri, 22 Jul 2011 22:16:04 +0400 MIME-Version: 1.0 Message-Id: <201107222216.04703.sshtylyov@ru.mvista.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Jul 2011 18:17:56 +0000 (UTC) The driver reads PCI subsystem IDs from the PCI configuration registers while they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}' fields of 'struct pci_dev'... Signed-off-by: Sergei Shtylyov --- The patch is against the recent Linus' tree. drivers/media/video/bt8xx/bttv-cards.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/media/video/bt8xx/bttv-cards.c =================================================================== --- linux-2.6.orig/drivers/media/video/bt8xx/bttv-cards.c +++ linux-2.6/drivers/media/video/bt8xx/bttv-cards.c @@ -2892,13 +2892,10 @@ void __devinit bttv_idcard(struct bttv * { unsigned int gpiobits; int i,type; - unsigned short tmp; /* read PCI subsystem ID */ - pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp); - btv->cardid = tmp << 16; - pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp); - btv->cardid |= tmp; + btv->cardid = btv->c.pci->subsystem_device << 16; + btv->cardid |= btv->c.pci->subsystem_vendor; if (0 != btv->cardid && 0xffffffff != btv->cardid) { /* look for the card */