From patchwork Tue Jun 20 16:50:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9799961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2349D60329 for ; Tue, 20 Jun 2017 16:50:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 224EB27DCD for ; Tue, 20 Jun 2017 16:50:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14255281E1; Tue, 20 Jun 2017 16:50:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EBC627DCD for ; Tue, 20 Jun 2017 16:50:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751036AbdFTQuz (ORCPT ); Tue, 20 Jun 2017 12:50:55 -0400 Received: from mail-by2nam03on0086.outbound.protection.outlook.com ([104.47.42.86]:57899 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751015AbdFTQuy (ORCPT ); Tue, 20 Jun 2017 12:50:54 -0400 Received: from BN6PR03CA0050.namprd03.prod.outlook.com (10.173.137.12) by BY2PR0301MB2008.namprd03.prod.outlook.com (10.163.196.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Tue, 20 Jun 2017 16:50:52 +0000 Received: from BY2FFO11FD004.protection.gbl (2a01:111:f400:7c0c::129) by BN6PR03CA0050.outlook.office365.com (2603:10b6:404:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15 via Frontend Transport; Tue, 20 Jun 2017 16:50:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.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 BY2FFO11FD004.mail.protection.outlook.com (10.1.14.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1178.14 via Frontend Transport; Tue, 20 Jun 2017 16:50:49 +0000 Received: from r49496.am.freescale.net (r49496.am.freescale.net [10.29.244.77]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5KGolc4007751; Tue, 20 Jun 2017 09:50:48 -0700 From: Fabio Estevam To: CC: , Fabio Estevam Subject: [PATCH] spi: imx: Check for allocation failure earlier Date: Tue, 20 Jun 2017 13:50:55 -0300 Message-ID: <1497977455-15964-1-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 2.7.4 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131424510518854195; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39450400003)(39860400002)(39380400002)(39850400002)(39400400002)(39840400002)(39410400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(50986999)(106466001)(2351001)(33646002)(105606002)(36756003)(6666003)(2906002)(6916009)(4326008)(5003940100001)(47776003)(54906002)(48376002)(50466002)(8656002)(86362001)(77096006)(110136004)(53936002)(38730400002)(50226002)(104016004)(356003)(8936002)(8676002)(81166006)(498600001)(5660300001)(189998001)(85426001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0301MB2008; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2FFO11FD004; 1:XF1jcUGCRvFmBZNsvQ0yOk2EHo4L7gjhLBoDqYIe5b?= =?us-ascii?Q?8fhROt/HzQVQEw0k/em1WbmMK9h6UXB+u0mx7M5dr1MFWrApPAUZkHERtpWh?= =?us-ascii?Q?HcHLK/DkCz55o6QuTxEqvQg7zriUiVg28KSUMdfhjCyLqsit+ZypBzb2Eiyg?= =?us-ascii?Q?toO83vRLoNHp9w0sbTeN9bug9A8Ul6IuPmz8jzKCEbg88h8Xw43cl7Jp0ZET?= =?us-ascii?Q?MGJGPFwpoo3P7KRLfOdCCpqWwNIvurnn+WD2J4so+s0GU2VEzMu7vr38E8bP?= =?us-ascii?Q?SaXpCDtR5Xmza3qbP6pYtTJO1A8Y+GUrSQoUJ2cLaD7copGLafgMcVBlobtJ?= =?us-ascii?Q?fSn9RDM6n3/UKn/v7Bt6A9CizVSYBEzvZyBwn77sod/AtpdOxXgS2ZTF8T77?= =?us-ascii?Q?KybvR1e8RfMneLLyooNH/MG7EEe0eOo79kMbmXC8hgCa/bqMl3tvooyvTaPi?= =?us-ascii?Q?lpZRwS0ZFeQ0zvZqUHRvXwB1E1ldac6pOcj+tYnCKP6FQqFLgQuDPmSfa+87?= =?us-ascii?Q?5YS5h1PPtFXn+mQn8FpqwqA6dXufHaq+A5f9EvKTszkRSpNWMaBb51jVIl7I?= =?us-ascii?Q?ZpVu17JsS7HlmBTEt9adV2v6Dcb7PAoiZYcpB+DoSk4P7FiPnzygyl7+gosj?= =?us-ascii?Q?6YZofVHyFSWcJsFQyR/n7YZCNwNKPtT5Zy58dwJTz8kUNltqflEv6wTTJcdk?= =?us-ascii?Q?XjEF0nnomwem2BeOTt0+pQDHvXSSUswsx+QIKXKq0MLZOB1QmCAPu/My0YLE?= =?us-ascii?Q?z2Tz4b9YKG9WgKCohwDeaHNj1ZpLUCzNnB930QAbEsit5qgG1jwfJBdOWCYU?= =?us-ascii?Q?Iutx4Q1NfrHXprbcjQzvF/Tdl3HQD22YX0iRkH4J6qmmZppk7uu5ZMBMKTmy?= =?us-ascii?Q?ErZyNTsa0vdwPlvBP1BW77jPoIm/GnbUW6l4gNzFgF7GEIS6KeuvrPjZFoBr?= =?us-ascii?Q?tSOKkWoc9myeupg5ss4nHbla6k94LxHj42i4YaQecm1Z6xmrLVHxvMcAAJyW?= =?us-ascii?Q?Bnqy65hEdYC95sgY0+t87rLHIAsRsYrAO+zhswEOcz8jPfNfopNwfgNoiZhS?= =?us-ascii?Q?aH9uo=3D?= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e735c760-3cb0-4bcc-df04-08d4b7fc8243 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY2PR0301MB2008; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 3:Wuz4/Cl3T0tptCvnMg0es4w5h4pcpjEze7gcp91ael312yLmVLLbKDI4NidqZJeX1MVuxF5vgj3PXKJd4wNaQ2Cqh7k17HqQFOzKHPK1ZwNGTw7iFg77EWlU0AfYuLn3Td7hAdjGv0t9KVwJFqxKvgJQGTul3Ptxec9UCD2Bf/fjYK72CJxjH0jaDeF8QM9S2CDG/QKjxYUJbCyiJlPiDOj8Jgogw7DvOUxZ9QRy9pkI6ZwFtjtPRjKlvvc6qFdPg2kxISMlV79D3HvHV4ogP1Rnda+NfyMqyCPYYbE3ffEW5+76xznwL4R/doVl/91LoxkvCL7+3dmPs3gkTPiNoFub7W8XXiTJ46g07E0nofAFhRA/v/U66owVS0nERPccr3rdy0X0YloovaqK4qRq/xxeNcd190La++0eiUEemWSC43Ao2QTbNH5WyxPYB9l4; 25:mV9RiTxqXqqTceBa0h2zjJEVGrGmuatDav27etmiNHIymAgtyPgaitaMJ1Kn5a6JMECRCIFAslFTDM9KU4WODTrzC5CgAudgFwvFhehLzKRgYWSkhtKyjGB5pMwWY6DuQ7eeJlponnWkUE1hQhdWD3ok4mn/GWPWWTEQxLqRThyGgMhxNiFEQRAun1fu+r3SxE6sfMaFq4RaNwbbaVPE2hAsxOuPKXNyjiGPQXiSo8f7t8cNcSCdt5UCB6gfKcI5z5vei09OK3dDhbPCPHWKm9zfJ2SNGiSXYYzJrvmBTYHzfVu9BzTknSFsB0DwhRdL0ofUAU+dnPiPa34Q91Qq3wyEjp4Sx4p5EFjyOc9aedsbd5RUjNxEvBS07JtGgVM/ZCaqWLcku2iuZXXlFCMbhCjkPc01qreqA3MOpcymnQ7k3kiCQWTrvNjDTmsHGwu8CyGinRGBaFJmT8sIzzd1PszStT3pGeK7pdQe zkIlNeA= X-MS-TrafficTypeDiagnostic: BY2PR0301MB2008: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 31:t4xb9nVsV6Vooc4mZRZXK4OBEwmVJ5dAxUzRRZereqwgKVFNWuENxLktrwx0hZqd5YkXu/oUk/LZlPswU4cu5B8qs/eLJREquEkSq1iWwpYuQePLoKfIVM+nF8G4ASkh4rz2R/Q0ZypMrIiDxxGjFLPqxTKdS4OduCoFdKrMI/5rhwOKb6tbONFac2tG6u/fXSNj+1bSibbAkbyB67av5LwCEw1vVqAtmAew/O8n7DlPpvp5zRR9b2My6kWaGSc6l0E57JgygmT5EB8PamJdMw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123563025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123556025)(20161123561025)(20161123565025)(20161123559100)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR0301MB2008; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR0301MB2008; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2008; 4:UKuCfreF0Wr2aZJPudGV5W05Xe9Bsa6/6AVkPc4w?= =?us-ascii?Q?kh4W3MyEdIDWL59GjeNRwDRXQeX8q5cdBqSRbAnjwM9mArfjus0GEa5SF1FL?= =?us-ascii?Q?Z/9QGq8pzyHm0D5tCVg6JzyDwWohjr9gqZGCsQTuWPT4iV2fCyrpSWNbsXxh?= =?us-ascii?Q?GAUH2I10QRYqmFFh05wHGbmrkvtZIVbiJe6LSWZVnVOjVF8d+jH4FG9C7rc8?= =?us-ascii?Q?lekVD2PCqVTpmklp9YNx9KQyfU9XlqlS6JCh6sTz2VBfzdo962R+3L9uTvdU?= =?us-ascii?Q?Uv3xWXLALHyIEeWJYTd0NlBlichb34oqzU9gqUdagvFFwqSQhHsnRZq3aHNB?= =?us-ascii?Q?9z6DE1850tDulK+CIfKBuEmXplXQUEoUnYCFttVHiXwkqYq2DfZHTH4a6KwG?= =?us-ascii?Q?i9gUfXCW+83FR2LlftpqkZPHpDxgV34jzP29ATBSUm9SKU7wx7NtmrzCNvIv?= =?us-ascii?Q?PraKbM9IzwVin5Xd/Se0ric0wAy8Uu0Ekr2UdnSdBx+PVUlBber2AZMuvpT2?= =?us-ascii?Q?NLw7cuvM4ygeI7rGhUAEXn5UAinFaOo6ynd5qFTPmjszyQiWJ0J67rREkAXl?= =?us-ascii?Q?TngIzgC1VfbbZFbO4D/FoYYz76HgsvugkoKatpQ1rP1QnLJr+6bkBlC1YDbt?= =?us-ascii?Q?OE+QlpxpUm5VlOR+Hzc9bsMQHO83ayL+wwIXIDaQiJM556EFLB5k4zZo67V7?= =?us-ascii?Q?Cikiq5rb5OzS1MLkQaR5jnhkGvt4FPP3EfKhnYE/n1q9HYDuJ1cLGV81qKlE?= =?us-ascii?Q?cSQDbXTVLFsFFEG8ZXqKm9Z26q7ih81OyfRqsjYiEYJiCcaXGg1SfQK/fcJE?= =?us-ascii?Q?RYFO/hLfs1iSuraz/U5KuWKUCdKzT1uLrWFPnBfT8OXOViE0NuOhxkIpBnWp?= =?us-ascii?Q?D272ws0rmJRrl9vWB7HkgQvfMXM1zADA+l7doGPBAGMSO0wY7FnDPdUmIYSM?= =?us-ascii?Q?377kB8Smv7b4+1hykOuK8cHnJs/AhpnUcbDZBlMo/BzzMfTREnEqfSJgClTl?= =?us-ascii?Q?i2vXYohcJBDFcB+flNkVvbLRYNSHAUCtnk8q9jRRoOYyZjh05+TantaRfVWy?= =?us-ascii?Q?rlfzWpq3LOg6cbn1jmoFjrWucXllPcydUoLZ4ykraeBTHExLkvTGsZORVpT9?= =?us-ascii?Q?aHB1dzK7ZTCvy4WlmYJtKsKrEB4yDFOI6JpRw6mld+dVweT/ioAbv7uxsxa2?= =?us-ascii?Q?d3QDfawsIurAe4f9XSaOfLfQdv+L9W5Gs/VXXp/gLvOyEqJ0KtUz9oDy9nkg?= =?us-ascii?Q?+TtcqJoOgonPp9aB4HDpohq++I35PAyd26ypoS3p?= X-Forefront-PRVS: 03449D5DD1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2008; 23:FPyfQcw9LNnUEUTSE7qJLlXiidAy30SLwK1tIbe?= =?us-ascii?Q?DgkacxRg8d28+GIbeBkHW05aYq6kl9tWIvRFhte+owSYmC8T56YZkNHjD1Y3?= =?us-ascii?Q?UzLAe/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?us-ascii?Q?jNJHlf3bzv5/ywLM+p9f47iNniajTjDTwJ/QW9r+A2SvuPBxrK6WAZ1Z4pS+?= =?us-ascii?Q?c57lw3URSO/cqJai78wDX6rh9oOL6krS1Mc7cb6tHwXoj8Y+TXn5EV3B4BbC?= =?us-ascii?Q?rMxCex90P3tlMVLlmRMYebYNLoM+tJvZqmyS4cotMfXAaBRy+VWbtdWbsyWo?= =?us-ascii?Q?cJuHdi0ZXL5M7GW4=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB2008; 6:1OpMQAeRf5H4fRLsc1GwA4BCjEYWasWTa9qO29DX?= =?us-ascii?Q?N4+admeFrMzXo4DWG1C72/3CEAPQzF1jsqe1xZLyJivmDG69JKEezabSTHLv?= =?us-ascii?Q?sHXm/rih1Y0O3OIWtZ8Fgf+CFHvRFF68/Vd5aB44TYasKSnQl7Sn8rmwrf/1?= =?us-ascii?Q?8hRay3Xk4kBSJWW39bT6RYDzorMsIDtq1s2kayQ6vDW8toXCYY4croi/0ZqA?= =?us-ascii?Q?ClUD4+V6joJ1Eh9nxiEcdsIVN+dmb0MggTpPPLaScWXgYvj/6xFkMySLoWc+?= =?us-ascii?Q?jr3SbWNTOETTAeSRkeHKl88HyauIYSzEElMFhvfJYfBoicQg5z5Vlem0FyZW?= =?us-ascii?Q?UjBZ20jqndFw8yamCfMx0JnOeav8P7e0VrbJMbCb+mkXPAnjlUee0jgzKgR3?= =?us-ascii?Q?0878bhat/QdjuaT36yHS5LgHL+BS77fN25QVywhoGClIGtON+iFcSLM2m9zI?= =?us-ascii?Q?m3RFE/yBiAdUfIt7/a3LmHBNJSuKAr9pned9qdJHVxIXO0qkLvjcC2I3BpGh?= =?us-ascii?Q?13exksey+jUsMN9zmNw5RbfOLS9bfUB4ArsIAZUJrTtXZhCpUK8Ps0Xdv/M5?= =?us-ascii?Q?Y6GSwVD+cH9GSGi1Z81Bdd2jxGd442HlGL+CuZcInc4UUuu/n42CrPSkWz+U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NpTa6Wf0udYBZ2CTHNYbyJ6U3ewXEgv2Kd731szA4u2FfvqRFL5dau0EQtAfJmJoE3swBiVaA8c5JI4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB2008; 7:S0DbvK6maWHxER2L1sB4BE7DnWvZ+sqBH3JzhvFNYYPz0t74bfZjRSdi3R9GXQk5A/ME/AiT6BsmrWy1HH6+i47XllVGuNiAJrtRwC6Sn3bfbglroRpwj8O/gnAoyw5M/D/h7Gn8ZYAlRZMcsVUaTCHvidwVu9G97fb2aSrt+W7KocPjqQI1WX4WSoyuS5kY0mB+LxsKIQm7hXoKh+2dEPd5BmJutVhdjaYg8yltzkOcURJZt4ZAmi3qiLsQ5OSwyLQkl7lRDwxgfkXghjSZXsaofgXs6Y6n8/cwiYyset/GrK8xod5EztiCRJhlckDQpIbHY/U4dZZw7juL/UOldIFljybAeCsZFJqMix7bWU6coAc0DXAYny9gyRAo0gKQAqaq52eP89DrQoY6xeKOq39S1xlUH8eZxNT/IsN24C1vFD329+kJo6lXJEbQjJW4h+BpeK81T/vX53FmsClroK/x8DJaIFkKbX1vHC8jZFMVGjxsTUmav3lu0gT0bEhcG+tr6XyuHl55ahahpsCbY97JxQ6CyA7xO5Ro+ytEI/1QwU8xuewHF17l0hA+/0xSSsct+htm6uEXBrHTyQ+ODNrCOHG88uWROOos0cNhv7lXsAjB8OqyCTEJqTH0mZ2LzlyGByCWU2z+CbTJ0PlyhibXu4LcgZtOSQGIXclTUnfHGLBPhT3ODY4RtXk9AC1crA71opgJE9cShpFVKIrQMVQxe3HT8u0Mr/QudbtSkWnzelxWl95Jqd+Fuw+A1lMnbNLFlTuoqKuHInoVRr5V1Wn8DBN+eX0Ov83t3cRTenk= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2017 16:50:49.8886 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB2008 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case of spi_alloc_master() failure it is better to return the error immediately, so move the error check right after the allocation. Signed-off-by: Fabio Estevam --- drivers/spi/spi-imx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index e544f45..f9698b7 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1169,15 +1169,15 @@ static int spi_imx_probe(struct platform_device *pdev) } master = spi_alloc_master(&pdev->dev, sizeof(struct spi_imx_data)); + if (!master) + return -ENOMEM; + ret = of_property_read_u32(np, "fsl,spi-rdy-drctl", &spi_drctl); if ((ret < 0) || (spi_drctl >= 0x3)) { /* '11' is reserved */ spi_drctl = 0; } - if (!master) - return -ENOMEM; - platform_set_drvdata(pdev, master); master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);