mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] memory: emif: use of_property_read_u32()
@ 2015-11-23 11:09 Saurabh Sengar
  0 siblings, 0 replies; only message in thread
From: Saurabh Sengar @ 2015-11-23 11:09 UTC (permalink / raw)
  To: ssantosh, linux-kernel; +Cc: Saurabh Sengar

use of_property_read_u32(), it will save few steps and variables

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
 drivers/memory/emif.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c
index 04644e7..52a9ad1 100644
--- a/drivers/memory/emif.c
+++ b/drivers/memory/emif.c
@@ -1262,11 +1262,10 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 		struct emif_data *emif)
 {
 	struct emif_custom_configs	*cust_cfgs = NULL;
-	int				len;
-	const __be32			*lpmode, *poll_intvl;
+	u32				lpmode = 0, poll_intvl = 0;
 
-	lpmode = of_get_property(np_emif, "low-power-mode", &len);
-	poll_intvl = of_get_property(np_emif, "temp-alert-poll-interval", &len);
+	of_property_read_u32(np_emif, "low-power-mode", &lpmode);
+	of_property_read_u32(np_emif, "temp-alert-poll-interval", &poll_intvl);
 
 	if (lpmode || poll_intvl)
 		cust_cfgs = devm_kzalloc(emif->dev, sizeof(*cust_cfgs),
@@ -1277,7 +1276,7 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 
 	if (lpmode) {
 		cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_LPMODE;
-		cust_cfgs->lpmode = be32_to_cpup(lpmode);
+		cust_cfgs->lpmode = lpmode;
 		of_property_read_u32(np_emif,
 				"low-power-mode-timeout-performance",
 				&cust_cfgs->lpmode_timeout_performance);
@@ -1292,11 +1291,10 @@ static void __init_or_module of_get_custom_configs(struct device_node *np_emif,
 	if (poll_intvl) {
 		cust_cfgs->mask |=
 				EMIF_CUSTOM_CONFIG_TEMP_ALERT_POLL_INTERVAL;
-		cust_cfgs->temp_alert_poll_interval_ms =
-						be32_to_cpup(poll_intvl);
+		cust_cfgs->temp_alert_poll_interval_ms = poll_intvl;
 	}
 
-	if (of_find_property(np_emif, "extended-temp-part", &len))
+	if (of_find_property(np_emif, "extended-temp-part", NULL))
 		cust_cfgs->mask |= EMIF_CUSTOM_CONFIG_EXTENDED_TEMP_PART;
 
 	if (!is_custom_config_valid(cust_cfgs, emif->dev)) {
-- 
1.9.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-23 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23 11:09 [PATCH] memory: emif: use of_property_read_u32() Saurabh Sengar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®