From patchwork Fri Jul 17 13:54:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Horia_Geant=C4=83?= X-Patchwork-Id: 6815891 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1DECFC05AC for ; Fri, 17 Jul 2015 13:56:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 30E34207A8 for ; Fri, 17 Jul 2015 13:56:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2A492066C for ; Fri, 17 Jul 2015 13:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751322AbbGQN4b (ORCPT ); Fri, 17 Jul 2015 09:56:31 -0400 Received: from mail-bn1bon0110.outbound.protection.outlook.com ([157.56.111.110]:63205 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751305AbbGQN4a (ORCPT ); Fri, 17 Jul 2015 09:56:30 -0400 Received: from BY2PR03CA039.namprd03.prod.outlook.com (10.141.249.12) by BLUPR03MB1396.namprd03.prod.outlook.com (10.163.81.142) with Microsoft SMTP Server (TLS) id 15.1.213.14; Fri, 17 Jul 2015 13:56:27 +0000 Received: from BY2FFO11FD039.protection.gbl (2a01:111:f400:7c0c::195) by BY2PR03CA039.outlook.office365.com (2a01:111:e400:2c5d::12) with Microsoft SMTP Server (TLS) id 15.1.219.17 via Frontend Transport; Fri, 17 Jul 2015 13:56:27 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD039.mail.protection.outlook.com (10.1.14.224) with Microsoft SMTP Server (TLS) id 15.1.213.8 via Frontend Transport; Fri, 17 Jul 2015 13:56:26 +0000 Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.77.120]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t6HDuOnx027168; Fri, 17 Jul 2015 06:56:25 -0700 From: =?UTF-8?q?Horia=20Geant=C4=83?= To: Herbert Xu CC: , Alex Porosanu Subject: [PATCH 1/4] crypto: caam - fix ERA property reading Date: Fri, 17 Jul 2015 16:54:51 +0300 Message-ID: <1437141294-15678-1-git-send-email-horia.geanta@freescale.com> X-Mailer: git-send-email 2.4.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD039; 1:HGZD0zfSjxOWDntd+2Z0VMquP4twM/4ioyRO279QoCQfLWwGW0n3EOoMGDOhDIVtPtLthKmKgF5Mwpdye9vUD98VAB6kc2OvF9z4Ey6Px3QwnvSOGvbW7CjzSXFv2xJai8UyfqWyR7PfQoq4OdhX20fZtYg1Ec8dbcr+H6Rkiu1kx4DNx18QqhMBnGWPs+VWC1yDpAM8dKDYtKxC5lDlQs5TLG05z2mNxuNCSNgis7SpdAkfCYVLtOicoPOkJLukK7GgT4QTOIDxp2FYP7jGPtuVxv4oXsO/4BSRRHBf9PqkFizTkZnAjTTvpgTraL8KNvK01eNcrMjfRCHOpUMlKbDVeAJ23RNMztIeI4+2IfpLfquosOyUxUvEe63eD+6UsdhlFVlDO49LfNeYTOPt+EIDqFpMCY3Syc6R0yEjZSLXHsLuBDLB9wYt508S8Q81 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(199003)(189002)(104016003)(50986999)(33646002)(229853001)(36756003)(77096005)(23676002)(50466002)(92566002)(50226001)(77156002)(62966003)(5820100001)(46102003)(86362001)(105606002)(87936001)(85426001)(189998001)(6806004)(19580405001)(47776003)(19580395003)(110136002)(5001960100002)(107886002)(106466001)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB1396; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1396; 2:p6QvLNpSfURImqwHr4E/kzy9DrRcvYQXN4ZbnBDV6LG7GuHA3EoxVCjieT1Kn34d; 3:RwLqGDBJyWmqozJmzCzcyks/zCfG6CbtttwUk18+mkqj4tOQFbt2pFESKcMlYxQ1qwaN/ePG71mS4LI4AaVXd7KbcEDhPgVtzaig0K6Su7jC41lQHwcymajIJykGTfnUmeBTyvVGaFVjfeodo6PIgpR8bItRm3QA6oXGzrPv5MvUz58bzhZkYOFJb2xLPKuVQkXHanlNK9RDjXfxIPai6miAw9VKjO+yF+rXzns6SQY=; 25:GVUNLjPWJ6r3niHbqHoSeR4i2aNbzrR3Wnwj5nqQchxEzvQxKEzVSy8wT8YBz8tddrECKND7AF4ngjvE1MfFMp8cdFiXgUcG9HvjrhRd27Y636c6qyMuYaKY1oQf2UNiItu1rC64DsJsqPDyGCc8Jn8vHXKPRER+5zRHOJ0MGA3AE5FA3DQHdRV8Y/1Kyyg9LH/xd1iIgSiZ/WefI8r61NrmBOx1ENjAHEi9gCrLwDlzzdcMPOv/Fd9925JpkFOBxo1sysSPmNt0YWmlLdOkbA==; 20:IBEyECaQusfb/hkuQpoxotHJBL043yHTZ26qO7m58XZ4FN4MT+qqRaaE90IYqIdga0G0tXDd0uTbLxan5FMmJWHm1o76ZSqRV8Z/XQsCKGxsC2zquyHNGlG5JdrW96ACLSB/JNDhVv7CYW43QtaVu/UlG211Du7G2XMDkTs39mXp9H2IQNgODc17SpKiW2T+5GuBl1lO1TB/wKRCTYy2VxrBrwn2vAipQf1PlFdUlKbB2F9X9DKiJqij9QYcZb0+b8mc5sgLqvsSq2KcjZRlzmyQrdujgZsPHXrzqCRqbJ7y0WpSayOKeCsfbzIUpPGnahiIbzkTO+UvQbn60w/ieM9du0S kvb5FuQjqEeEWpm8= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB1396; BLUPR03MB1396: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BLUPR03MB1396; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB1396; X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1396; 4:Q8o6eJf+/qqJdsCYSdX4ULsoyQehBngHo7kUq/pBZPHSJa149aW1QQYWUNtud5a+oiuSrgzKiggORDf6lQGdWCgYa+/U/fGTw3lC3YdsKyvJa1pABzukWN0jOHLgt63lLksDDC7voWKqXUpfKA2Fsftg95Bs4M9OIkjGGpyNg4IiSqVwbqDelEbn/SFU02vUEkfppHBSZjsUXpUpBvrJ56GzbTB46SGmtxiyE9yhatCb9u/kEeKoVv/8eqABf0mo4U4tF4OJtuFvVFSzaHNGJ+5l4lX7PmT5gFPHEIxB2EA= X-Forefront-PRVS: 06400060E1 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB1396; 23:x8T5Vv0Z04701eorgdEAVzFmcAsFIbzuVJSXtj15a8DXSwwaoqjcXIiwbbpV3o5j/3dxCwTvEK/oPQXZcQ94T1QCTL8W4iFwUczd5aLX7/2460A9iO5XSGDl7+8epoOu4UIfW1vjMf1mb5osPHjntVRTqcDnsi9nB/Au7qjMoC40tr2rtq+r8gaLxX5xaPdSa17BR8L3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zv67FQ0quq9ubgrT8VPQw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2015 13:56:26.6022 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB1396 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Porosanu In order to ensure that the ERA property is properly read from DT on all platforms, of_property_read* function needs to be used. Signed-off-by: Alex Porosanu Signed-off-by: Horia Geant? --- drivers/crypto/caam/ctrl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index efacab7539ef..598823746a3b 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c @@ -370,14 +370,14 @@ static void kick_trng(struct platform_device *pdev, int ent_delay) int caam_get_era(void) { struct device_node *caam_node; - for_each_compatible_node(caam_node, NULL, "fsl,sec-v4.0") { - const uint32_t *prop = (uint32_t *)of_get_property(caam_node, - "fsl,sec-era", - NULL); - return prop ? *prop : -ENOTSUPP; - } + int ret; + u32 prop; + + caam_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); + ret = of_property_read_u32(caam_node, "fsl,sec-era", &prop); + of_node_put(caam_node); - return -ENOTSUPP; + return IS_ERR_VALUE(ret) ? -ENOTSUPP : prop; } EXPORT_SYMBOL(caam_get_era);