Skip to contentSkip to conversation

mfd: max8997: cast void pointer to data of max8997_pmic_dt_match

PATCH Applied Jingoo Han 2 participants 2 messages Aug 1, 2013 Multifunction devices (MFD)

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 mfd: max8997: cast void pointer to data of max8997_pmic_dt_match

Casting (void *) data of max8997_pmic_dt_match is necessary, because variable 'data' of struct 'of_device_id' is defined as 'const void *data'. Thus, pointer should be used instead of value.

---
 drivers/mfd/max8997.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/max8997.c +1 -1
index 1471405..e6d668a 100644
@@ -51,7 +51,7 @@ static struct mfd_cell max8997_devs[] = {
 
 #ifdef CONFIG_OF
 static struct of_device_id max8997_pmic_dt_match[] = {
-	{ .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 },
+	{ .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 },
 	{},
 };
 #endif
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 14 lines · Jingoo Han

Casting (void *) data of max8997_pmic_dt_match is necessary, because variable 'data' of struct 'of_device_id' is defined as 'const void *data'. Thus, pointer should be used instead of value.

---
 drivers/mfd/max8997.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/max8997.c +0 -0
index 1471405..e6d668a 100644

drivers/mfd/max8997.c static struct mfd_cell max8997_devs[] = { · line 57

Quoted 8 lines
drivers/mfd/max8997.c +1 -1
@@ -51,7 +51,7 @@ static struct mfd_cell max8997_devs[] = {
 
 #ifdef CONFIG_OF
 static struct of_device_id max8997_pmic_dt_match[] = {
-	{ .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 },
+	{ .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 },
 	{},
 };
 #endif

Applied, thanks.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog