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: 474597 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 28F5D140284 for ; Thu, 21 May 2015 04:03:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=K8fmudGA; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754774AbbETSDn (ORCPT ); Wed, 20 May 2015 14:03:43 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:36603 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752851AbbETSDd (ORCPT ); Wed, 20 May 2015 14:03:33 -0400 Received: by lagv1 with SMTP id v1so85678714lag.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 Cc: Joachim Eastwood , netdev@vger.kernel.org, davem@davemloft.net, arnd@arndb.de, linux-arm-kernel@lists.infradead.org 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> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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;