Skip to contentSkip to conversation

MFD: rdc321x: change resources flags to IORESOURCE_IO

PATCH Superseded Florian Fainelli 1 participant 2 messages May 15, 2010

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MFD: rdc321x: change resources flags to IORESOURCE_IO

The rdc321x southbridge PCI device has no MEM PCI resources that we could pass to mfd_add_devices. Since 33254dd5, mfd_add_device checks for the mem_base argument that we set to NULL. Changing the resources passed to our MFD cells from IORESOURCE_MEM to IORESOURCE_IO fixes that. Since we use those resources as offsets to the PCI configuration space base address of the southbridge device this is also more adequate.

---

drivers/gpio/rdc321x-gpio.c +1 -1
index e344907..9ec3c51 100644
@@ -147,7 +147,7 @@ static int __devinit rdc321x_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpio-reg1");
+	r = platform_get_resource_byname(pdev, IORESOURCE_IO, "gpio-reg1");
 	if (!r) {
 		dev_err(&pdev->dev, "failed to get gpio-reg1 resource\n");
 		err = -ENODEV;
drivers/mfd/rdc321x-southbridge.c +3 -3
index 256dd56..5092297 100644
@@ -34,7 +34,7 @@ static struct resource rdc321x_wdt_resource[] = {
 		.name	= "wdt-reg",
 		.start	= RDC321X_WDT_CTRL,
 		.end	= RDC321X_WDT_CTRL + 0x3,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}
 };
 
@@ -47,12 +47,12 @@ static struct resource rdc321x_gpio_resources[] = {
 		.name	= "gpio-reg1",
 		.start	= RDC321X_GPIO_CTRL_REG1,
 		.end	= RDC321X_GPIO_CTRL_REG1 + 0x7,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}, {
 		.name	= "gpio-reg2",
 		.start	= RDC321X_GPIO_CTRL_REG2,
 		.end	= RDC321X_GPIO_CTRL_REG2 + 0x7,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}
 };
 
drivers/watchdog/rdc321x_wdt.c +1 -1
index 4733a99..428f8a1 100644
@@ -237,7 +237,7 @@ static int __devinit rdc321x_wdt_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wdt-reg");
+	r = platform_get_resource_byname(pdev, IORESOURCE_IO, "wdt-reg");
 	if (!r) {
 		dev_err(&pdev->dev, "failed to get wdt-reg resource\n");
 		return -ENODEV;
#1 lore raw
Quoted 14 lines · Fainelli

The rdc321x southbridge PCI device has no MEM PCI resources that we could pass to mfd_add_devices. Since 33254dd5, mfd_add_device checks for the mem_base argument that we set to NULL. Changing the resources passed to our MFD cells from IORESOURCE_MEM to IORESOURCE_IO fixes that. Since we use those resources as offsets to the PCI configuration space base address of the southbridge device this is also more adequate.

---

drivers/gpio/rdc321x-gpio.c +0 -0
index e344907..9ec3c51 100644

drivers/gpio/rdc321x-gpio.c static int __devinit rdc321x_gpio_probe(struct · line 153

Quoted 8 lines
drivers/gpio/rdc321x-gpio.c +1 -1
@@ -147,7 +147,7 @@ static int __devinit rdc321x_gpio_probe(struct
 platform_device *pdev) return -ENOMEM;
 	}
 
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpio-reg1");
+	r = platform_get_resource_byname(pdev, IORESOURCE_IO, "gpio-reg1");
 	if (!r) {
 		dev_err(&pdev->dev, "failed to get gpio-reg1 resource\n");
 		err = -ENODEV;

I missed one hunk here, please discard this version of the patch.

Quoted 42 lines
(quoted diff) +0 -0
 b/drivers/mfd/rdc321x-southbridge.c index 256dd56..5092297 100644
drivers/mfd/rdc321x-southbridge.c +3 -3
@@ -34,7 +34,7 @@ static struct resource rdc321x_wdt_resource[] = {
 		.name	= "wdt-reg",
 		.start	= RDC321X_WDT_CTRL,
 		.end	= RDC321X_WDT_CTRL + 0x3,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}
 };
 
@@ -47,12 +47,12 @@ static struct resource rdc321x_gpio_resources[] = {
 		.name	= "gpio-reg1",
 		.start	= RDC321X_GPIO_CTRL_REG1,
 		.end	= RDC321X_GPIO_CTRL_REG1 + 0x7,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}, {
 		.name	= "gpio-reg2",
 		.start	= RDC321X_GPIO_CTRL_REG2,
 		.end	= RDC321X_GPIO_CTRL_REG2 + 0x7,
-		.flags	= IORESOURCE_MEM,
+		.flags	= IORESOURCE_IO,
 	}
 };
 
(quoted diff) +0 -0
 b/drivers/watchdog/rdc321x_wdt.c index 4733a99..428f8a1 100644
drivers/watchdog/rdc321x_wdt.c +1 -1
@@ -237,7 +237,7 @@ static int __devinit rdc321x_wdt_probe(struct
 platform_device *pdev) return -ENODEV;
 	}
 
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wdt-reg");
+	r = platform_get_resource_byname(pdev, IORESOURCE_IO, "wdt-reg");
 	if (!r) {
 		dev_err(&pdev->dev, "failed to get wdt-reg resource\n");
 		return -ENODEV;