From patchwork Mon May 28 02:52:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Li X-Patchwork-Id: 10429717 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 32FBB601C7 for ; Mon, 28 May 2018 03:10:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22F5928AF4 for ; Mon, 28 May 2018 03:10:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14F6728AF7; Mon, 28 May 2018 03:10:02 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 92EC728AF4 for ; Mon, 28 May 2018 03:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753153AbeE1DKA (ORCPT ); Sun, 27 May 2018 23:10:00 -0400 Received: from mail-eopbgr00059.outbound.protection.outlook.com ([40.107.0.59]:46304 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753149AbeE1DJ6 (ORCPT ); Sun, 27 May 2018 23:09:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w0n8RWqEtlckGB3LUK8pPTW97Qjl7vuxXIx5BdC/o0c=; b=nsg0v2S3n3+RrKERUYLfviBOkKN5vfK2MNK7HjMyIhyrg9p2CNna8zYw7WUOT29lOl9GV6o6aX5ERzjEsHsqKUFQQBlc2pv9t19ZhpzrMy91T5mB1lTXRd7nj5gRvaGlYO2vosW7MYCRF7oGgNYbJl+IH/T2PLYw6yXv8rq6lBs= Received: from b47624-OptiPlex-7040.ap.freescale.net (92.121.68.129) by VI1PR0402MB3919.eurprd04.prod.outlook.com (2603:10a6:803:22::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Mon, 28 May 2018 03:09:50 +0000 From: Li Jun To: robh+dt@kernel.org, gregkh@linuxfoundation.org, heikki.krogerus@linux.intel.com, linux@roeck-us.net Cc: cw00.choi@samsung.com, a.hajda@samsung.com, shufan_lee@richtek.com, peter.chen@nxp.com, garsilva@embeddedor.com, gsomlo@gmail.com, jun.li@nxp.com, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH v6 08/15] staging: typec: tcpci: use IS_ERR() instead of PTR_ERR_OR_ZERO() Date: Mon, 28 May 2018 10:52:40 +0800 Message-Id: <1527475967-15201-9-git-send-email-jun.li@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527475967-15201-1-git-send-email-jun.li@nxp.com> References: <1527475967-15201-1-git-send-email-jun.li@nxp.com> MIME-Version: 1.0 X-Originating-IP: [92.121.68.129] X-ClientProxiedBy: HK2PR0302CA0015.apcprd03.prod.outlook.com (2603:1096:202::25) To VI1PR0402MB3919.eurprd04.prod.outlook.com (2603:10a6:803:22::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR0402MB3919; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 3:OiTkPqkGwnttllr2nI91XOLUi9vFhLE8+hMR3G4V3YIUybyU0ddHo/rR7W4w4yaB0w/MqCL2dv1wZ6h4fnW4jnwHWDknpWbSMjmep/8R4NMMHCEbf08hNW7wzL6ht+3hES5n4tVE0voivp8KYbNBEmAEJ40qLie2TFXII+GON9f6xKcTGQewDTHHo8Lbe/z2n4bTg9inFtsetmemq0aKFLsiOfs2wjK7THm0BC5n7DSERRDz75ueJK4NS1hGfGdr; 25:tubW5E6lckpCiEaGKPpq72on4BScZy5hLMnaSBWDo4hviEmEnD467fpDhttA5v7gcHgt5YTV8LF32f9vKqToubtx4sRabCzNc/5M3BXsMPvmfX8M8K8QoBCsBbqCuy8fHElF81rIcst0KbVdd8QGM9vSWQL+/WiB/bVUxd/BIzC6v0W+QQmP/fQzT+tLCrJrbtKSEF4CLLnxCzSKqn7xbdSrGnlG8S/lXO3JIQDEAnYwy6VdSjNyOoF37fZJtjnb4KyApJ6HZAAbc3FLGscwpL3GSOsLfeKM0fM9VRffrIdxx6X8mG7kvk1/m3KWwOY9iJIZbaIP+cR03BpG5NpVLw==; 31:E9MErftIAOSOH5C9WuODmq+QqW2YTbnBpb2Iwanqz+hjrPHW8/66EG2Fr13kS4Bpvn2Rv7J7pV+zez9f6nLpws0hNEJW0YuOZFB5ThpJKHTSaddfvEbfUW75PY5D4mOUkMpYlbYjeN4YFvzi1XH6fxqMs3lYyL/2jlYQWcuKkHDs0y3JRIJsfI8NnEqntPkvaPHH3zSXLH0XtFvLoRctsaZLfO8KMtgI+I9fwLa1yyY= X-MS-TrafficTypeDiagnostic: VI1PR0402MB3919: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jun.li@nxp.com; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0402MB3919; 20:r5ANumnPLJkp/WGvdKngGrET2mtBWlVm9UKjK/chILBVZLAjlDrVkNlGycnLTgpoGjVkR7eQQ5dFHCQcWvS8SKc3tpXX9slhsrUN+s3C+PQpzRv8ItaCN4lB6oLxWMRHcqweiUBYP/OsYcuHLngaEPOFMfhqom3jjNwjWzmISuDmzrG3Fxr2E8+gKUIIDqDsWG2m1LE8umJeiHwKL8cErKshqbAnBE5R3JC58ovm9pXI7jMku81kX9yNo21ly3UgqknuMumkTbKSV1zoAKmeXWfGimIbpRsUqkgrdqsdEQvS8ze8IsIBd7Ha+5Wl25kqSq9Bwkojsc8NpOx6tN6iWQBG/1QNIAU1R0B5qhwOpIZLclDAQXk5aGVaUaGurqSyMp3UKCUlV7H/ZMmN0CQoeXFVXznNk4+2XqNhq2MleWuD0qagKtbcVw5eKcHQEz7tlbni4J7Dn0CSvkm6OXBgqI+o8gYhH16gkYZzVibov+a3+4F7ohCNOXl2SX78P9Lm; 4:iWVULTW01IVSiPMIKzMn2lWtLly9M6yelv05Y2ZCOya0KjTLTw7bHIFP5YaO5r6v9h7fxy0RIXUgt0zXsL9moLMM+WjtaIEkMhqlgkazXRzmZQoTrpUG5bSQjmOf2eQR3zfarp9YU1b82vs04mRrlywg/WDmxdTpWQfJefTGODygXWyCK5cD+NN+N268uUJi2F7HuJ2EOJnYlwOWnki4pgV4LFjy9roWkQchQx3q4C+y7bAQHU9TFANlNVBXXPX7g6hs9VoqrFGWTvYP3gFo5DmDjeJV4zOjPhhum0dB6iqbe4BFtJRStPl+kE1OmtX0 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0402MB3919; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0402MB3919; X-Forefront-PRVS: 06860EDC7B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(396003)(39860400002)(366004)(346002)(376002)(199004)(189003)(6506007)(8676002)(16526019)(305945005)(26005)(7736002)(386003)(486006)(446003)(48376002)(11346002)(956004)(2616005)(2906002)(66066001)(81156014)(186003)(3846002)(81166006)(478600001)(8936002)(50466002)(6486002)(5660300001)(6116002)(6666003)(7416002)(36756003)(50226002)(47776003)(39060400002)(476003)(86362001)(106356001)(68736007)(53936002)(51416003)(105586002)(16586007)(316002)(4326008)(6512007)(76176011)(97736004)(25786009)(52116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0402MB3919; H:b47624-OptiPlex-7040.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0402MB3919; 23:EQ1PkKCLI/Unr7hgJnBeAUaHWMcMvIpkPt7OUKN?= =?us-ascii?Q?Q3jWzdVAnvWgjHvQYQoofWTuVdntkYwt0MIUjcW5ueWblHZFVB6sFOMcC8/y?= =?us-ascii?Q?amiycUEvJM75KFxTH7wcMZscIC5KuX3QN+jfALEBlMYx91KTs5quNCCxbHUa?= =?us-ascii?Q?yyZAmcNYjbtBFfxSQBzL5d3Srk3rzo5h9XML94tWj/J1iedBdesnJsJ8enkG?= =?us-ascii?Q?cSYF/pngQ99VVD7+1SkTCKQUDYklCTIvnLTmE49aqt7fm6VJaDf9Y3wFVQIq?= =?us-ascii?Q?xUWhnqEppJOTnaC/bxWoph00kcOpHgJmdJ0BnMsup7+QYGmciTh8vrurAfKx?= =?us-ascii?Q?eg3NbeCRfBth7D+sRgleBSn0mAwwMDTDLbtl5dfw++C1zF24r3Gkp5d2PjIs?= =?us-ascii?Q?lbwhhajqbA2Xv6BSnk7bnQV93rfF+wQCc9vnNFiWLuh/zABoFbNG/evQdDL3?= =?us-ascii?Q?sErdE+TQ6CUa53pFRDl1Gbb7J5m/F9N2GvojExjPpXttGo7KuYHjIVieuAye?= =?us-ascii?Q?AkC8SQWr5RMG4xCt6/7eDBxlt4rJ5WbQbikpCvMvuvk0dgHn2lvIWColEisP?= =?us-ascii?Q?Y3B7OfNGiAEF1qP8pOAiQ0IkWu8hJA64Y4G/+mtv7FpAcz/kWlWW9X2zic0W?= =?us-ascii?Q?zk/2y7GCA20LUcOSmP7suJMzmY7Z7ue52jpmUsKGZXuokvXNeEoxNsboXT3R?= =?us-ascii?Q?BnscxK0b3//pWf5LwVZFHni18O1lP6aPSGKT2zI1kYzfHNM1c/qArKbUR0hj?= =?us-ascii?Q?MOxZoVZLq4b37mjD3htM4xwkxwS4CZRMsLttNHmZvGGQFYPiLVmjQUg9FoPQ?= =?us-ascii?Q?dc6Rc31eHT1TDVnVgDf95D/Ms0hvjsTSY0HfNGN7mTUvH9LDU1RAqlF2ufco?= =?us-ascii?Q?BTMcmdEtDPbuff88E6wifIi7n894BYhGipze++MyapFe2s9JqYkYF8o9ebqR?= =?us-ascii?Q?sX0Pb7bJiwqb6tJrfue8OaCIcetZ0vYhfKyJtAaXKiINiFGlNBc5sDICpD0H?= =?us-ascii?Q?6avTqm6Zxq6U3WRBri1jSVfm1efCKJOrcZj8F+mWwmBpQusq0gsQBQ6872hf?= =?us-ascii?Q?pLFCe4I094wAfNZLZbnC7ow8a5A09DM0n7lDUveDNkllXpUcMK2zOdoi4OYj?= =?us-ascii?Q?WVUpjtkpNkQU2NNJOnVMFCrB+Ka3u5Phr/WM8cxEs87Rq5RIFAvktxNMt4In?= =?us-ascii?Q?x7ydzXUU5wfz2Xd4CEvMxMmXg72ROknGGiNal?= X-Microsoft-Antispam-Message-Info: ImBR0q/2X3i8T02M+DZWJwa4R4QlA3rB6vrRehPyAyW1TPHdVa3ysxoD1145JOy1eewKnrWTYfZ+0LAKQX+k4SaFyDpQnBaKSDneelrqae4QqnTmEfIjKxw5GzjWqUU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MOLx/7pFMq3U0ghnfbQoVKlnsuFK27kmHPtJVYKdYYB7QXau+bQna/eLIG+cKoPrtLD6djbHjYCkAu1SYBF5cp8Ie8dZ3BNF+gvHYrLVP+m/YlTjaTGb9Cc33PM1ejjPzy/ X-MS-Office365-Filtering-Correlation-Id: e25062dd-3a20-483a-6419-08d5c4487d38 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2018 03:09:50.3923 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e25062dd-3a20-483a-6419-08d5c4487d38 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3919 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As tcpm_register_port() and tcpci_register_port() never return NULL and NULL is not a success in this case, use IS_ERR() to check the return value of both. Signed-off-by: Li Jun Reviewed-by: Heikki Krogerus --- drivers/staging/typec/tcpci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 076498a..b63f147 100644 --- a/drivers/staging/typec/tcpci.c +++ b/drivers/staging/typec/tcpci.c @@ -509,7 +509,7 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data) return ERR_PTR(err); tcpci->port = tcpm_register_port(tcpci->dev, &tcpci->tcpc); - if (PTR_ERR_OR_ZERO(tcpci->port)) + if (IS_ERR(tcpci->port)) return ERR_CAST(tcpci->port); return tcpci; @@ -551,7 +551,7 @@ static int tcpci_probe(struct i2c_client *client, return err; chip->tcpci = tcpci_register_port(&client->dev, &chip->data); - if (PTR_ERR_OR_ZERO(chip->tcpci)) + if (IS_ERR(chip->tcpci)) return PTR_ERR(chip->tcpci); i2c_set_clientdata(client, chip);