Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbbKWLJV (ORCPT ); Mon, 23 Nov 2015 06:09:21 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35570 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbbKWLJU (ORCPT ); Mon, 23 Nov 2015 06:09:20 -0500 From: Saurabh Sengar To: ssantosh@kernel.org, linux-kernel@vger.kernel.org Cc: Saurabh Sengar Subject: [PATCH] memory: emif: use of_property_read_u32() Date: Mon, 23 Nov 2015 16:39:05 +0530 Message-Id: <1448276945-3289-1-git-send-email-saurabh.truth@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2195 Lines: 57 use of_property_read_u32(), it will save few steps and variables Signed-off-by: Saurabh Sengar --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/