From patchwork Tue Sep 13 10:49:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 114476 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 BA1CEB71BD for ; Tue, 13 Sep 2011 20:50:00 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582Ab1IMKtw (ORCPT ); Tue, 13 Sep 2011 06:49:52 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:58976 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752356Ab1IMKtv (ORCPT ); Tue, 13 Sep 2011 06:49:51 -0400 Received: by wwf22 with SMTP id 22so577738wwf.1 for ; Tue, 13 Sep 2011 03:49:50 -0700 (PDT) Received: by 10.216.133.5 with SMTP id p5mr727318wei.87.1315910990628; Tue, 13 Sep 2011 03:49:50 -0700 (PDT) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id r27sm15896wbn.10.2011.09.13.03.49.48 (version=SSLv3 cipher=OTHER); Tue, 13 Sep 2011 03:49:49 -0700 (PDT) From: Dave Martin To: netdev@vger.kernel.org Cc: patches@linaro.org, Steve Glendinning , Shawn Guo , devicetree-discuss@lists.ozlabs.org, Dave Martin Subject: [PATCH] net/smsc911x: Correctly configure 16-bit register access from DT Date: Tue, 13 Sep 2011 11:49:29 +0100 Message-Id: <1315910969-4018-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The SMSC911X_USE_16BIT needs to be set when using 16-bit register access. However, currently no flag is set if the device tree doesn't specify 32-bit access, resulting in a BUG() and a non- working driver when 16-bit register access is configured for smsc911x in the DT. This patch should set the SMSC911X_USE_16BIT flag in a manner consistent with the documented DT bindings. Signed-off-by: Dave Martin Acked-by: Grant Likely --- drivers/net/ethernet/smsc/smsc911x.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 788c4fd..a3aa4c0 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -2121,6 +2121,8 @@ static int __devinit smsc911x_probe_config_dt( of_property_read_u32(np, "reg-io-width", &width); if (width == 4) config->flags |= SMSC911X_USE_32BIT; + else + config->flags |= SMSC911X_USE_16BIT; if (of_get_property(np, "smsc,irq-active-high", NULL)) config->irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH;