Skip to contentSkip to conversation

mfd: mt6397: Use PLATFORM_DEVID_NONE macro instead of -1

PATCH Superseded Fabien Parent 2 participants 4 messages Jun 18, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mfd: mt6397: Use PLATFORM_DEVID_NONE macro instead of -1

Use the correct macro when adding the MFD devices instead of using directly '-1' value.

---
 drivers/mfd/mt6397-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/mfd/mt6397-core.c +6 -6
index 337bcccdb914..190ed86ad93e 100644
@@ -299,9 +299,9 @@ static int mt6397_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 
-		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
-					   ARRAY_SIZE(mt6323_devs), NULL,
-					   0, pmic->irq_domain);
+		ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
+					   mt6323_devs, ARRAY_SIZE(mt6323_devs),
+					   NULL, 0, pmic->irq_domain);
 		break;
 
 	case MT6397_CID_CODE:
@@ -314,9 +314,9 @@ static int mt6397_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 
-		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
-					   ARRAY_SIZE(mt6397_devs), NULL,
-					   0, pmic->irq_domain);
+		ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
+					   mt6397_devs, ARRAY_SIZE(mt6397_devs),
+					   NULL, 0, pmic->irq_domain);
 		break;
 
 	default:
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 mfd: mt6397: use DEFINE_RES_* helpers to define RTC resources

Use the DEFINE_RES_{MEM,IRQ} to define the RTC reosurce for the MT6397 PMIC.

---
 drivers/mfd/mt6397-core.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/mfd/mt6397-core.c +2 -10
index 190ed86ad93e..1e315712870b 100644
@@ -23,16 +23,8 @@
 #define MT6397_CID_CODE		0x97
 
 static const struct resource mt6397_rtc_resources[] = {
-	{
-		.start = MT6397_RTC_BASE,
-		.end   = MT6397_RTC_BASE + MT6397_RTC_SIZE,
-		.flags = IORESOURCE_MEM,
-	},
-	{
-		.start = MT6397_IRQ_RTC,
-		.end   = MT6397_IRQ_RTC,
-		.flags = IORESOURCE_IRQ,
-	},
+	DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
+	DEFINE_RES_IRQ(MT6397_IRQ_RTC),
 };
 
 static const struct resource mt6323_keys_resources[] = {
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/2
#3 lore raw
In reply to Fabien Parent
Quoted 4 lines · Fabien Parent

Use the correct macro when adding the MFD devices instead of using directly '-1' value.

Quoted 35 lines
---
 drivers/mfd/mt6397-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/mfd/mt6397-core.c +6 -6
index 337bcccdb914..190ed86ad93e 100644
@@ -299,9 +299,9 @@ static int mt6397_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 
-		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6323_devs,
-					   ARRAY_SIZE(mt6323_devs), NULL,
-					   0, pmic->irq_domain);
+		ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
+					   mt6323_devs, ARRAY_SIZE(mt6323_devs),
+					   NULL, 0, pmic->irq_domain);
 		break;
 
 	case MT6397_CID_CODE:
@@ -314,9 +314,9 @@ static int mt6397_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 
-		ret = devm_mfd_add_devices(&pdev->dev, -1, mt6397_devs,
-					   ARRAY_SIZE(mt6397_devs), NULL,
-					   0, pmic->irq_domain);
+		ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
+					   mt6397_devs, ARRAY_SIZE(mt6397_devs),
+					   NULL, 0, pmic->irq_domain);
 		break;
 
 	default:
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] mfd: mt6397: use DEFINE_RES_* helpers to define RTC resources

In reply to Fabien Parent
Quoted 4 lines · Fabien Parent

Use the DEFINE_RES_{MEM,IRQ} to define the RTC reosurce for the MT6397 PMIC.

Quoted 28 lines
---
 drivers/mfd/mt6397-core.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/mfd/mt6397-core.c +2 -10
index 190ed86ad93e..1e315712870b 100644
@@ -23,16 +23,8 @@
 #define MT6397_CID_CODE		0x97
 
 static const struct resource mt6397_rtc_resources[] = {
-	{
-		.start = MT6397_RTC_BASE,
-		.end   = MT6397_RTC_BASE + MT6397_RTC_SIZE,
-		.flags = IORESOURCE_MEM,
-	},
-	{
-		.start = MT6397_IRQ_RTC,
-		.end   = MT6397_IRQ_RTC,
-		.flags = IORESOURCE_IRQ,
-	},
+	DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
+	DEFINE_RES_IRQ(MT6397_IRQ_RTC),
 };
 
 static const struct resource mt6323_keys_resources[] = {