Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760136AbXEPHUg (ORCPT ); Wed, 16 May 2007 03:20:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756106AbXEPHU2 (ORCPT ); Wed, 16 May 2007 03:20:28 -0400 Received: from canuck.infradead.org ([209.217.80.40]:34226 "EHLO canuck.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754352AbXEPHU1 (ORCPT ); Wed, 16 May 2007 03:20:27 -0400 Date: Wed, 16 May 2007 00:18:51 -0700 From: Greg KH To: Manu Abraham Cc: linux-kernel Subject: Re: pci probe Message-ID: <20070516071851.GB19294@kroah.com> References: <4648B29A.6080406@gmail.com> <4649B270.8050002@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4649B270.8050002@gmail.com> User-Agent: Mutt/1.5.15 (2007-04-06) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1956 Lines: 47 On Tue, May 15, 2007 at 05:15:28PM +0400, Manu Abraham wrote: > Manu Abraham wrote: > > Hi, > > > > I do have a device that's a multifunction device. Eventhough a MFD, it > > just has one Interrupt which is shared by by a Configuration space for > > each function. ie, INTA is shared between them functions. > > > > In such a case, i am wondering, (since pci_probe returns a pointer to > > one PCI function alone and i need to use both the functions in one > > module alone rather than using a module for each function and that the > > functions are quite similar for them to be used in different modules, > > such that a separate probe/ISR etc is used) whether using pci_get_device > > would be a better alternative to do manual searching for the functions > > in such a case. > > > > Just figured out that pci_get_subsys() does work in a better. Looking at > kernel sources all i find is just one single user of pci_get_subsys() > > building the code around pci_get_subsys(), does this have any negative > impact ? Yes: - your device will not show up properly in sysfs (no device/driver binding ability from userspace, no good information so that udev can properly name the device, etc.) - your driver will not work on any pci-hotplug type system (that includes expresscard and pccard and lots of high-end servers. - your driver will not be notified if the system is being suspended or resumed or wanting to drop into a low power state. - another driver can bind to your device without you ever knowing it. So in short, use pci_probe and just handle the fact that you need to be called for two PCI devices and bind to both of them. It shouldn't be that hard... thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/