From patchwork Mon Mar 14 14:07:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8579281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9EA349F54C for ; Mon, 14 Mar 2016 14:10:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25A98203ED for ; Mon, 14 Mar 2016 14:10:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31AA2201E4 for ; Mon, 14 Mar 2016 14:09:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1afTAT-0007JA-Oa; Mon, 14 Mar 2016 14:08:21 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1afTA9-0007BR-2z; Mon, 14 Mar 2016 14:08:03 +0000 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0Ld3z6-1ZxMtZ0BA8-00iBai; Mon, 14 Mar 2016 15:07:33 +0100 From: Arnd Bergmann To: "David S. Miller" Subject: [PATCH 3/3] net: mediatek: check device_reset return code Date: Mon, 14 Mar 2016 15:07:12 +0100 Message-Id: <1457964435-2945038-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457964435-2945038-1-git-send-email-arnd@arndb.de> References: <1457964435-2945038-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:moborJx9hta0ILrsffUY+DVapFVFp/NaPy9gpF0FQt1+Z87p9mo yXXiTxTtuuzquPPEjqEcgP63r74AYR+ZFhy5OWoQOkrLM9ATe3MIzWfUwtIv4igY3H4ue0V Bf3uW2wOyQJgERf3ROBA10Jeye7ORlt1ueyEA7DJXMqaJp+PBSHTYDVumqbAOPT0NB/sguO EXzgUoW3UKEgeMF2ObzDw== X-UI-Out-Filterresults: notjunk:1; V01:K0:trQ9PG6JotM=:0t8B34YwZMHkN18Xo6L+dO 9SZip44JvLowf8lzNKgNQnoVi9euTNwnxH36tqiPdJps5ijub5e78GSNsBE5W1YtxYmMLsHp+ y7CfUcPbs6o6iCmdx5N1VZ4vDRa2dsCcz7Z0oPFEEBqA27vT+F6F7vI80z73UKb4N76A6mfGC /aWCMraQkl9xJtagdx/82HPlTVrKF2MpUwWwKKkw/48c88FvnOVFNgHkLNy8hG2H9V87QDevq BnD8K5PCRAr7ZuJkD8ne1DGt0vD79b23uZz4MvqDmcEzbCJ39oA3by/x/jvQFXjIxfk7LuSL5 efk3WgUWmtIhQaG5yMcdy96CrzVj1tMCeVVBM+Y6M4Bb5KnSJ4uY8voI4lSi5EgZwJP+CamZN AJdcHfz05NDN+kqGY/7TeJArwTwIc4CeS92dZLT+FFkioJfAwRukBR9/gt22SdEirP93gsIdp 5Zxx7KGbPk6OILw/XrF3pSdsdrqu89mNKpGVZZs2gCWX+9kXuK1Ys3vioeCS5k54TzdvP0ixu SFBm7gSDlM6tz/YwMDRgN0NCd7/ZsRedVFOerUq+lIRFNz7CTyJiM+v70v7AkSt6V61cx9yWx one53RERQNqE2ra0Yy266eWCZYR5yu3BRdwJ32H3Wse+OejzyQaKBnUscPPNtkvHviL0lYIUe qhvRAkTM7d6+mPzUqDkE0wgU6Rv2xptB690AZM8S3qMXLThGCdHkvRAtc9UOfP/KB9lA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160314_070801_671102_10B33483 X-CRM114-Status: GOOD ( 11.31 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felix Fietkau , Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org, John Crispin MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The device_reset() function may fail, so we have to check its return value, e.g. to make deferred probing work correctly. gcc warns about it because of the warn_unused_result attribute: drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_probe': drivers/net/ethernet/mediatek/mtk_eth_soc.c:1679:2: error: ignoring return value of 'device_reset', declared with attribute warn_unused_result [-Werror=unused-result] This adds the trivial error check to propagate the return value to the generic platform device probe code. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 87f417712da0..1e6c5498bba9 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1676,7 +1676,9 @@ static int mtk_probe(struct platform_device *pdev) struct mtk_eth *eth; int err; - device_reset(&pdev->dev); + err = device_reset(&pdev->dev); + if (err) + return err; match = of_match_device(of_mtk_match, &pdev->dev); soc = (struct mtk_soc_data *)match->data;