Re: [PATCH V2 5/6] MIPS: lantiq: convert pci to managed gpio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello.

On 23-02-2012 20:01, John Crispin wrote:

ltq_gpio_request() now uses devres to manage the gpios. We need to pass a
struct device pointer to make it work.

Signed-off-by: John Crispin<blogic@xxxxxxxxxxx>
[...]

diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
index 3bf42c8..47b5d8e 100644
--- a/arch/mips/pci/pci-lantiq.c
+++ b/arch/mips/pci/pci-lantiq.c
@@ -150,24 +150,26 @@ static u32 ltq_calc_bar11mask(void)
  	return bar11mask;
  }

-static void ltq_pci_setup_gpio(int gpio)
+static void ltq_pci_setup_gpio(struct device *dev)
  {
+	struct ltq_pci_data *conf = (struct ltq_pci_data *) dev->platform_data;
  	int i;
  	for (i = 0; i<  ARRAY_SIZE(ltq_pci_gpio_map); i++) {
-		if (gpio & (1 << i)) {
-			ltq_gpio_request(ltq_pci_gpio_map[i].pin,
+		if (conf->gpio & (1 << i)) {
+			ltq_gpio_request(dev, ltq_pci_gpio_map[i].pin,
  				ltq_pci_gpio_map[i].mux,
  				ltq_pci_gpio_map[i].dir,
  				ltq_pci_gpio_map[i].name);
  		}
  	}
-	ltq_gpio_request(21, 0, 1, "pci-reset");
-	ltq_pci_req_mask = (gpio>>  PCI_REQ_SHIFT)&  PCI_REQ_MASK;
+	ltq_gpio_request(dev, 21, 0, 1, "pci-reset");

   This needs to be merged with patch 1.

WBR, Sergei



[Linux MIPS Home]     [LKML Archive]     [Linux ARM]     [Linux]     [Git]     [Photo]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

Add to Google Powered by Linux