Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4431079imm; Tue, 7 Aug 2018 01:08:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeKBm8fzHkWWQ3gal+vaXxW9J6PfBvuVDydMh5NgS+RGhhWBISyWMg54neOP2Wq0C7tz4w0 X-Received: by 2002:a17:902:d68d:: with SMTP id v13-v6mr4945172ply.278.1533629324267; Tue, 07 Aug 2018 01:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533629324; cv=none; d=google.com; s=arc-20160816; b=w2ZMzD300s04tAxgEFO9mUujRINdun0hJZS+dkHOhs1F+lypxHT1t0Igt+vGqPHzot hh49nMbC+Ky3FNdUGmO25wH4ASCEL+rzTZiOlcGrHsCjG357NUw/MLDGv3kQpdiu1TAp iaoyalAp1TG3q/dtLIuyCSbWN7JghFgDlvujiXACyzKnY/uy76JgX9JUbbdxU/IW828Q GBHyW5hysm6p22V8QfoHxfwlJqvUEpSUnfUgE9K9kTYWOJTXbLozMxYtEAfw7ysnnyyy 4DHej1SkG17qHJVOv1VrK9aG0pp4JcpoDjesPh6pRpnQ3lMKuubN35d23mqIBCmvm5+g u1mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:arc-authentication-results; bh=GE/fYjIuio1/pTL8bdFFc+pv3Uk68paDEfNifPHmXWs=; b=mtRZRRV1rn6zBdeziVZaCqrQl7V0elV0nYNr4dxlgDa5H6/hkM2676OSIKTGnnolGM WVe+O89i1XDbVJz+W5W+5RUdxQ8D0xa1i6rtktEjbht1SuQy2BtoJuiV+ttXqOJbZmwI bvyJMcvD4jA0VPNJIuOcrnHidPDE+2XlLHDcOyB8wjgtTps02EAveL6pFmcmgwvTmiMO 6M0wtiAAhr7MykOlNs9+v9mAFcRmh1IpNi0I7QdNQi3IZYEEP11HxPSjQcTerbxR1GHS OT9mn0Y/jVVdBPvNPL4LxYg7ycsGbbBpRxxI8iRCX/H0dboO1NHlux01jgLRSLt1hjPX dlvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c189-v6si673631pga.259.2018.08.07.01.08.29; Tue, 07 Aug 2018 01:08:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388872AbeHGJqx (ORCPT + 99 others); Tue, 7 Aug 2018 05:46:53 -0400 Received: from mail-ua0-f196.google.com ([209.85.217.196]:38656 "EHLO mail-ua0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732805AbeHGJqx (ORCPT ); Tue, 7 Aug 2018 05:46:53 -0400 Received: by mail-ua0-f196.google.com with SMTP id o11-v6so15068345uak.5; Tue, 07 Aug 2018 00:33:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GE/fYjIuio1/pTL8bdFFc+pv3Uk68paDEfNifPHmXWs=; b=kRCazbIZcFhm67uwFIStF7WwZE9ZpQ8Lq0X4I0+6myDc1uvY2et+q3Lg0cRz3CwYWl 7IVW0UWs+zLE1Ls7Jb0uNIVAFmqkUdPE3dl+8dsSMkmmo/jFNgBwnYNYP4cxiooMVyQg SaFXSZcp05ZWNqfFyRapJA7I3GK9zlNHPzHVBAPwPJOlZg/FJPh3c6340VcVtkUfeDVD NNyyb0PdC5SU/rG1TT65BEP4BEw1JUJ3xsCxKa0Gn6sgdtTbS5plVJzi79TV790ul5E9 CxJgxAc3sjkyJUDsKrFgiNRs1WEzWLfH6ISvCdswl72YRWWw4qe6ZCqpvuQGYx88RmE0 05Fg== X-Gm-Message-State: AOUpUlF5w+KZYUs+QbpIsorLMRr/Jfod339Kym+YAnVsL7zF3ybIxDrH D0Z15JbQ/eMbudz2EqH/W+qnRbsbu5VOk4DBFRc= X-Received: by 2002:a1f:8948:: with SMTP id l69-v6mr11835313vkd.132.1533627230008; Tue, 07 Aug 2018 00:33:50 -0700 (PDT) MIME-Version: 1.0 References: <20180803030237.3366-1-songjun.wu@linux.intel.com> <20180803030237.3366-9-songjun.wu@linux.intel.com> In-Reply-To: <20180803030237.3366-9-songjun.wu@linux.intel.com> From: Geert Uytterhoeven Date: Tue, 7 Aug 2018 09:33:38 +0200 Message-ID: Subject: Re: [PATCH v2 08/18] serial: intel: Get serial id from dts To: songjun.wu@linux.intel.com Cc: hua.ma@linux.intel.com, yixin.zhu@linux.intel.com, chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com, Linux MIPS Mailing List , linux-clk , "open list:SERIAL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Greg KH , Linux Kernel Mailing List , Jiri Slaby Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Songjun, On Fri, Aug 3, 2018 at 5:04 AM Songjun Wu wrote: > Get serial id from dts. > > "#ifdef CONFIG_LANTIQ" preprocessor is used because LTQ_EARLY_ASC > macro is defined in lantiq_soc.h. > lantiq_soc.h is in arch path for legacy product support. > > arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h > > If "#ifdef preprocessor" is changed to > "if (IS_ENABLED(CONFIG_LANTIQ))", when CONFIG_LANTIQ is not enabled, > code using LTQ_EARLY_ASC is compiled. > Compilation will fail for no LTQ_EARLY_ASC defined. > > Signed-off-by: Songjun Wu Thanks for your patch! > @@ -699,9 +700,19 @@ lqasc_probe(struct platform_device *pdev) > return -ENODEV; > } > > - /* check if this is the console port */ > - if (mmres->start != CPHYSADDR(LTQ_EARLY_ASC)) > - line = 1; > + /* get serial id */ > + line = of_alias_get_id(node, "serial"); > + if (line < 0) { > +#ifdef CONFIG_LANTIQ > + if (mmres->start == CPHYSADDR(LTQ_EARLY_ASC)) > + line = 0; > + else > + line = 1; > +#else > + dev_err(&pdev->dev, "failed to get alias id, errno %d\n", line); > + return line; Please note that not providing a fallback here makes life harder when using DT overlays. See the description of commit 7678f4c20fa7670f ("serial: sh-sci: Add support for dynamic instances") for background info. > +#endif > + } > > if (lqasc_port[line]) { > dev_err(&pdev->dev, "port %d already allocated\n", line); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds