Re: finding pci_dev from scsi_device

From: Arjan van de Ven
Date: Mon Jun 26 2006 - 10:40:14 EST


On Mon, 2006-06-26 at 16:24 +0200, Herbert Rosmanith wrote:
> >
> > > > can you share with us what you want to do with this?
> > >
> > > I need the pci_dev to reconfigure ahci-controllers so that they look like
> > > having been initialised by BIOS at reboot time.
> >
> > isn't it better to do this in the ahci driver itself instead?
>
> guess what I'm doing.
>
> > it for sure will be orders of magnitude easier....
>
> yes?

static int ahci_host_init(struct ata_probe_ent *probe_ent)
{
struct ahci_host_priv *hpriv = probe_ent->private_data;
struct pci_dev *pdev = to_pci_dev(probe_ent->dev);

as you can see, you can easily go from an ata_probe_ent to a pci
device...

also.. you could just put your code into the remove hook... :)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/