[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140801123352.GA30397@infradead.org>
Date: Fri, 1 Aug 2014 05:33:52 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Ching Huang <ching2048@...ca.com.tw>
Cc: hch@...radead.org, jbottomley@...allels.com,
dan.carpenter@...cle.com, thenzl@...hat.com, agordeev@...hat.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1.3 6/18] arcmsr: precise checking adapter ID
> -static void arcmsr_define_adapter_type(struct AdapterControlBlock *acb)
> +static bool arcmsr_define_adapter_type(struct AdapterControlBlock *acb)
> {
> struct pci_dev *pdev = acb->pdev;
> u16 dev_id;
> +
> pci_read_config_word(pdev, PCI_DEVICE_ID, &dev_id);
> acb->dev_id = dev_id;
This is already available through pdev->device.
> acb->adapter_type = ACB_ADAPTER_TYPE_C;
Just store the adapter type in the pci_device_id private data field,
that way you enumerate the type in the same place the ids are added
and you'll never miss adding them to a switch value.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists