From owner-svn-src-head@FreeBSD.ORG Wed Aug 21 05:52:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 71EBA9E7 for ; Wed, 21 Aug 2013 05:52:28 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03E452845 for ; Wed, 21 Aug 2013 05:52:27 +0000 (UTC) Received: by mail-ea0-f173.google.com with SMTP id g10so590609eak.18 for ; Tue, 20 Aug 2013 22:52:19 -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=lG57RakDWi/q+vfeMzDhFgClAQUsCJJSbfvB3tuNdBY6qbbUFNvSJGquKwIoQww1Is OlhWEFFU2s3zCzpZXUAvccLAqBnF2mJZRZ063AQ4quBAO5VmKqslHvBcp4KZT0OZeh63 wAy6Tg/93/flQtFsCCWWVbNmKS3+CscsSIvCG2wG/AASZJzkISdFVNz4DpuFVHc43gt8 M0LxPeJMNAvplzzguCaQxBSkp73lcYZfZA95mM+gO34u+JU33ekqNxX4t0Eqn46PquQd pl45SQs87eCO63NqEhgOwTwVdKr6Jv0aMJiG4hN3nwqaJzrOQF3LcfzLI/4/9uWSUXjx dd0w== X-Gm-Message-State: ALoCoQlbqrerg5lsvOIT+fIStuPigEBi69LQzKZeDsOC/D1w1NH1QFpyu4c3MIeQqE5Ik7fCJQR9 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 05:52:28 -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