Skip to contentSkip to conversation

mfd: mc13xxx-core: use of_property_read_bool()

PATCH In review Saurabh Sengar 2 participants 3 messages Nov 16, 2015 – Dec 3, 2015 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: mc13xxx-core: use of_property_read_bool()

for checking if a property is present or not, use of_property_read_bool instead of of_get_property()

---
 drivers/mfd/mc13xxx-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/mc13xxx-core.c +4 -4
index 3f9f4c8..d7f54e4 100644
@@ -383,16 +383,16 @@ static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
 	if (!np)
 		return -ENODEV;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-adc", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-adc"))
 		mc13xxx->flags |= MC13XXX_USE_ADC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-codec", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-codec"))
 		mc13xxx->flags |= MC13XXX_USE_CODEC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-rtc", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-rtc"))
 		mc13xxx->flags |= MC13XXX_USE_RTC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-touch", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-touch"))
 		mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN;
 
 	return 0;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Saurabh Sengar

for checking if a property is present or not, use of_property_read_bool instead of of_get_property()

---
 drivers/mfd/mc13xxx-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

I'm fine with the change, but in future please use the commit format expected of the subsystem. In this case, you are missing upper-case characters at the start of the subject line AND the start of the commit log. In fact, it is devoid of sufficient punctuation in general.

I have applied this and fixed up the issues; this time!

Quoted 25 lines
drivers/mfd/mc13xxx-core.c +4 -4
index 3f9f4c8..d7f54e4 100644
@@ -383,16 +383,16 @@ static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
 	if (!np)
 		return -ENODEV;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-adc", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-adc"))
 		mc13xxx->flags |= MC13XXX_USE_ADC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-codec", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-codec"))
 		mc13xxx->flags |= MC13XXX_USE_CODEC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-rtc", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-rtc"))
 		mc13xxx->flags |= MC13XXX_USE_RTC;
 
-	if (of_get_property(np, "fsl,mc13xxx-uses-touch", NULL))
+	if (of_property_read_bool(np, "fsl,mc13xxx-uses-touch"))
 		mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN;
 
 	return 0;
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

I couldn't see this patch applied in linux-next branch still.

Regards,
Saurabh

Quoted 49 lines · Lee Jones
Quoted 7 lines · Saurabh Sengar

for checking if a property is present or not, use of_property_read_bool instead of of_get_property()

---
 drivers/mfd/mc13xxx-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

I'm fine with the change, but in future please use the commit format expected of the subsystem. In this case, you are missing upper-case characters at the start of the subject line AND the start of the commit log. In fact, it is devoid of sufficient punctuation in general.

I have applied this and fixed up the issues; this time!

Quoted 15 lines
drivers/mfd/mc13xxx-core.c +2 -2
index 3f9f4c8..d7f54e4 100644
@@ -383,16 +383,16 @@ static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
      if (!np)
              return -ENODEV;
 
-     if (of_get_property(np, "fsl,mc13xxx-uses-adc", NULL))
+     if (of_property_read_bool(np, "fsl,mc13xxx-uses-adc"))
              mc13xxx->flags |= MC13XXX_USE_ADC;
 
-     if (of_get_property(np, "fsl,mc13xxx-uses-codec", NULL))
+     if (of_property_read_bool(np, "fsl,mc13xxx-uses-codec"))
              mc13xxx->flags |= MC13XXX_USE_CODEC;

drivers/mfd/mc13xxx-core.c static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx) · line 398

Quoted 10 lines
drivers/mfd/mc13xxx-core.c +2 -2
 
-     if (of_get_property(np, "fsl,mc13xxx-uses-rtc", NULL))
+     if (of_property_read_bool(np, "fsl,mc13xxx-uses-rtc"))
              mc13xxx->flags |= MC13XXX_USE_RTC;
 
-     if (of_get_property(np, "fsl,mc13xxx-uses-touch", NULL))
+     if (of_property_read_bool(np, "fsl,mc13xxx-uses-touch"))
              mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN;
 
      return 0;

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead

Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog