From patchwork Mon Sep 26 07:41:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 4326 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2632823EFA for ; Mon, 26 Sep 2011 07:41:29 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 1010DA18984 for ; Mon, 26 Sep 2011 07:41:29 +0000 (UTC) Received: by fxe23 with SMTP id 23so7968621fxe.11 for ; Mon, 26 Sep 2011 00:41:28 -0700 (PDT) Received: by 10.223.45.140 with SMTP id e12mr3157096faf.27.1317022888847; Mon, 26 Sep 2011 00:41:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.234 with SMTP id f10cs28311laf; Mon, 26 Sep 2011 00:41:28 -0700 (PDT) Received: by 10.204.142.204 with SMTP id r12mr4010711bku.388.1317022888041; Mon, 26 Sep 2011 00:41:28 -0700 (PDT) Received: from mail.df.lth.se (mail.df.lth.se. [194.47.250.12]) by mx.google.com with ESMTPS id s5si11747669bke.156.2011.09.26.00.41.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 00:41:27 -0700 (PDT) Received-SPF: pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) client-ip=194.47.250.12; Authentication-Results: mx.google.com; spf=pass (google.com: domain of triad@df.lth.se designates 194.47.250.12 as permitted sender) smtp.mail=triad@df.lth.se Received: from mer.df.lth.se (mer.df.lth.se [194.47.250.37]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.df.lth.se (Postfix) with ESMTPS id 9005165D75; Mon, 26 Sep 2011 09:41:24 +0200 (CEST) Received: from mer.df.lth.se (triad@localhost.localdomain [127.0.0.1]) by mer.df.lth.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id p8Q7fO2G032306; Mon, 26 Sep 2011 09:41:24 +0200 Received: (from triad@localhost) by mer.df.lth.se (8.14.3/8.14.3/Submit) id p8Q7fLIo032305; Mon, 26 Sep 2011 09:41:21 +0200 From: Linus Walleij To: Wolfgang Denk , u-boot@lists.denx.de Cc: Linus Walleij Subject: [PATCH] net: dc2114x: check for apropriate command Date: Mon, 26 Sep 2011 09:41:14 +0200 Message-Id: <1317022874-32278-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.7.2.5 The code had two paths depending on whether the card was to be accessed from plain memory or the IO region. However the error path checks whether IO region was obtained - twice. Fix up the error path according to the probable intention. Signed-off-by: Linus Walleij --- drivers/net/dc2114x.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c index 51e7c19..0fb616a 100644 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@ -245,15 +245,17 @@ int dc21x4x_initialize(bd_t *bis) pci_write_config_word(devbusfn, PCI_COMMAND, status); pci_read_config_word(devbusfn, PCI_COMMAND, &status); +#ifdef CONFIG_TULIP_USE_IO if (!(status & PCI_COMMAND_IO)) { printf("Error: Can not enable I/O access.\n"); continue; } - - if (!(status & PCI_COMMAND_IO)) { - printf("Error: Can not enable I/O access.\n"); +#else + if (!(status & PCI_COMMAND_MEMORY)) { + printf("Error: Can not enable MEMORY access.\n"); continue; } +#endif if (!(status & PCI_COMMAND_MASTER)) { printf("Error: Can not enable Bus Mastering.\n");