From patchwork Tue Mar 6 13:29:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 10261673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D2466602C8 for ; Tue, 6 Mar 2018 13:29:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C21C528F78 for ; Tue, 6 Mar 2018 13:29:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6B5D28F4F; Tue, 6 Mar 2018 13:29:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 400D328F4F for ; Tue, 6 Mar 2018 13:29:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BUb4BEPrjKrzaNqeUrZphzzDWlONMPH76axMEP5FkFM=; b=cFr9ExeKJEH6I5 d+9y9i+iXP8bSUUwousnlznPAFmNUvkhsdnS+5kxjlyucPsU4zfl1YZ9uvDdRB0+Pc9rQYA+D2A0N HZYRCBh1psMXaDG8V+6jXBx5Tdxc2qgQjkQZoWRnyZtnnDZOt2xm0U+8oUc7muzCdJ8k30MkB1Gei 88d5OQp64LdlMXwVHcbusTj1DTtSlew82v3wzaY5+r+dbXmxB2XQ+oQwY+GIoHtvhVdS7+B8m3CJl JfjocaA65Ue7rMCvHOtT9v7YUAiSNDK249KDlBGNvsZLeaLrQpfcuJzNlHqfuo2MVmcenxoeH4D4L QRfFc2DDUxM0OOZGKHoA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etCf8-0006ZG-3Z; Tue, 06 Mar 2018 13:29:50 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etCf4-0006XT-Vi for linux-arm-kernel@lists.infradead.org; Tue, 06 Mar 2018 13:29:48 +0000 Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com [209.85.161.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C24D217A0 for ; Tue, 6 Mar 2018 13:29:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C24D217A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=robh+dt@kernel.org Received: by mail-yw0-f179.google.com with SMTP id w12so6872714ywa.8 for ; Tue, 06 Mar 2018 05:29:36 -0800 (PST) X-Gm-Message-State: AElRT7GhpS1u8SwQtT+oEd7tQyKRrobqHiwUSFKHeKWOXetjBa7ilQo5 P7pvjcydOEotRCGlosPt0UZTTc1oH3Q7zQmLjA== X-Google-Smtp-Source: AG47ELtofapYpBPnY8Y9eAoq3zYia7dGwivDlWDX6mGIOISyvUm26+CecV0afDjdfcoT6bSTzg0uqhgtS8JJjquHMaQ= X-Received: by 10.129.141.65 with SMTP id w1mr9178843ywj.386.1520342975478; Tue, 06 Mar 2018 05:29:35 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:8007:0:0:0:0:0 with HTTP; Tue, 6 Mar 2018 05:29:15 -0800 (PST) In-Reply-To: <1520323650-11030-4-git-send-email-patrice.chotard@st.com> References: <1520323650-11030-1-git-send-email-patrice.chotard@st.com> <1520323650-11030-4-git-send-email-patrice.chotard@st.com> From: Rob Herring Date: Tue, 6 Mar 2018 07:29:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/3] tty: st-asc: Update tty alias To: Patrice Chotard X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180306_052947_063945_465D1047 X-CRM114-Status: GOOD ( 17.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Greg Kroah-Hartman , Russell King , "linux-kernel@vger.kernel.org" , linux-serial@vger.kernel.org, Jiri Slaby , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 6, 2018 at 2:07 AM, wrote: > From: Patrice Chotard > > Since dtc v1.4.6-9-gaadd0b65c987, aliases property name > must include only lowercase and '-'. > > After having updated all STi boards serial aliases from "ttyASN" > to "serialN", st-asc driver need to be updated accordingly as tty > aliases id is retrieved using of_alias_get_id(np, ASC_SERIAL_NAME); Again, changing the tty name breaks userspace. You can't do that. You need to do something like this: id = 0; diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index c763253514e9..5f9f01fac6dd 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -782,7 +782,9 @@ static struct asc_port *asc_of_get_asc_port(struct platform_device *pdev) if (!np) return NULL; - id = of_alias_get_id(np, ASC_SERIAL_NAME); + id = of_alias_get_id(np, "serial"); + if (id < 0) + id = of_alias_get_id(np, ASC_SERIAL_NAME); if (id < 0)