From patchwork Wed May 20 18:03:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Eastwood X-Patchwork-Id: 6448361 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 9C12C9F1CC for ; Wed, 20 May 2015 18:07:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6888201FA for ; Wed, 20 May 2015 18:07:42 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 433292010C for ; Wed, 20 May 2015 18:07:41 +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 1Yv8MO-0004qC-OS; Wed, 20 May 2015 18:04:53 +0000 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yv8LS-0004Hk-B2 for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2015 18:03:55 +0000 Received: by lbbqq2 with SMTP id qq2so538457lbb.3 for ; Wed, 20 May 2015 11:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zfToU5NwnjqXmncYSwJbDMEPYcBZNycJZrFctqFlv0I=; b=K8fmudGAh3iFk0Fchs/njqDAJJPaAJqLOQBWF7LaSGDMiCKSFcHVe0L5HKgU27zhV+ 3zZDC4xaYglYt1aM8b3bXfGIKsqlyUfn5XZ/J8MDmsHYYfvX3ldRLESQ6LF4hdc4n2qP yDMbOetP5Q8u32B7D63QcgGQfwibB/XYxEGX3gymOAY+/ViuUjgqkbH3Wvf7lBzZ7+gC uQbrbLHqfMBf25fqFLItUie0XRknjLLrud5YpXSHKg5lX28DjHByleVUMsNm3Ea22XxS Ms5tm8J7ddtbTkZz840DHnfGK+yUIphiQ4oUCpUmqMRcha7Rj1y4OliKSmn5naot7hai 0BNg== X-Received: by 10.152.18.227 with SMTP id z3mr26725212lad.6.1432145011910; Wed, 20 May 2015 11:03:31 -0700 (PDT) Received: from localhost.localdomain (183.90-149-48.nextgentel.com. [90.149.48.183]) by mx.google.com with ESMTPSA id si3sm4773856lbb.32.2015.05.20.11.03.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 May 2015 11:03:31 -0700 (PDT) From: Joachim Eastwood To: peppe.cavallaro@st.com Subject: [PATCH net-next 4/4] stmmac: drop unnecessary dt checks in stmmac_probe_config_dt Date: Wed, 20 May 2015 20:03:09 +0200 Message-Id: <1432144989-28283-5-git-send-email-manabian@gmail.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1432144989-28283-1-git-send-email-manabian@gmail.com> References: <1432144989-28283-1-git-send-email-manabian@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150520_110354_618266_F4C01464 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -0.8 (/) Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Joachim Eastwood , davem@davemloft.net, arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Since the caller already check the presence of a of_node there is no need to repeat the check in stmmac_probe_config_dt. There is also no point in checking the return value of the of_match_device function since if there wasn't match in the first place we would never be in this function. Signed-off-by: Joachim Eastwood --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 10de9351a1ec..d2bb7907bf61 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -111,13 +111,7 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, const struct of_device_id *device; struct device *dev = &pdev->dev; - if (!np) - return -ENODEV; - device = of_match_device(dev->driver->of_match_table, dev); - if (!device) - return -ENODEV; - if (device->data) { const struct stmmac_of_data *data = device->data; plat->has_gmac = data->has_gmac;