From owner-svn-src-all@FreeBSD.ORG Wed Aug 21 06:09:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4F9C5BAC for ; Wed, 21 Aug 2013 06:09:22 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D773A28E7 for ; Wed, 21 Aug 2013 06:09:21 +0000 (UTC) Received: by mail-ee0-f47.google.com with SMTP id d49so1019eek.20 for ; Tue, 20 Aug 2013 23:09:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-type:content-transfer-encoding:subject:from:date:to :message-id; bh=HLMv5mO3wcvTHB2yr/uFjcioHTC/ZW4PoxynRgnl3Gk=; b=bbr0Bcq+ysdCwEXWaVQkyYG3RMtKMq/C1TQNQR059n9/0/NCRUylbu1Z3XLx+uczG0 s95KRAFjxVUGTk9xuAwMtWZ99aNA9pOjgZ7BScpl8KH12frD2fmKkduYB6LpXS+LSbdT 0vB9VvpqV70U/mSyWwio+nf3BNIacjLNk7/ns/JXqjkQfyUVPJdh/YW5UAiE7pDH1Ose yq393xrzfuT/DyXNE9wFa/Yf5iCWFg1xjzPF90jJObfgYk2E6gSYLqlqIy5yJvzrxiOa LOdos+C/hih7vbQLgG2MyVfMlfyuCRMbbZR1MNz6lgXriNuKDawdk8k1wNbmJPVo2fdR /R3w== X-Gm-Message-State: ALoCoQnRlCeBRBbfUXD2VSDfmLh8mlat7BjnaqyAE2/3+MXfvPGwdKTtqK99O6r3AxNI1tTka5Si X-Received: by 10.15.64.1 with SMTP id n1mr7721600eex.15.1377063938872; Tue, 20 Aug 2013 22:45:38 -0700 (PDT) Received: from [159.160.207.62] ([159.160.207.62]) by mx.google.com with ESMTPSA id t6sm6903905eel.12.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Aug 2013 22:45:37 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <201308210408.r7L48w2X045489@svn.freebsd.org> References: <201308210408.r7L48w2X045489@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: svn commit: r254590 - head/sys/dev/uart From: Aleksandr Rybalko Date: Wed, 21 Aug 2013 08:45:25 +0300 To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 06:09:22 -0000 Ian Lepore написав(ла): >Author: ian >Date: Wed Aug 21 04:08:58 2013 >New Revision: 254590 >URL: http://svnweb.freebsd.org/changeset/base/254590 > >Log: > Use an if/else sequence rather than unrelated if statements, so that a >device compatible with multiple drivers matches the more specific >driver > first and doesn't overwrite it later with the more generic. Move the > generic ns16550 to the end of the list. > >Modified: > head/sys/dev/uart/uart_cpu_fdt.c > >Modified: head/sys/dev/uart/uart_cpu_fdt.c >============================================================================== >--- head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:05:06 2013 (r254589) >+++ head/sys/dev/uart/uart_cpu_fdt.c Wed Aug 21 04:08:58 2013 (r254590) >@@ -141,18 +141,18 @@ uart_cpu_getdev(int devtype, struct uart > */ > if (fdt_is_compatible(node, "fsl,imx-uart")) > class = &uart_imx_class; >- if (fdt_is_compatible(node, "quicc")) >+ else if (fdt_is_compatible(node, "quicc")) > class = &uart_quicc_class; >- if (fdt_is_compatible(node, "lpc")) >+ else if (fdt_is_compatible(node, "lpc")) > class = &uart_lpc_class; >- if (fdt_is_compatible(node, "ns16550")) >- class = &uart_ns8250_class; >- if (fdt_is_compatible(node, "arm,pl011")) >+ else if (fdt_is_compatible(node, "arm,pl011")) > class = &uart_pl011_class; >- if (fdt_is_compatible(node, "exynos")) >+ else if (fdt_is_compatible(node, "exynos")) > class = &uart_s3c2410_class; >- if (fdt_is_compatible(node, "cadence,uart")) >+ else if (fdt_is_compatible(node, "cadence,uart")) > class = &uart_cdnc_class; >+ else if (fdt_is_compatible(node, "ns16550")) >+ class = &uart_ns8250_class; > > di->bas.chan = 0; > di->bas.regshft = (u_int)shift; Hi Ian! Correct order should be specified in compatible list, other thing must be covered by some quirks. Maybe inside driver or in machine/board specific fixup handler. Thanks. WBW ------ Aleksandr Rybalko