Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3809687ybi; Mon, 29 Jul 2019 13:04:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkIr72h8439glvP92VeYNcQ5OPmqXawBVTYdhur4xZoUPEf1CD0CRDkHJwfA+zD24IAS5/ X-Received: by 2002:a17:902:820c:: with SMTP id x12mr112890582pln.216.1564430646910; Mon, 29 Jul 2019 13:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430646; cv=none; d=google.com; s=arc-20160816; b=M0fp6sulJgj08Fz6PV2JGqpHQeJyQHeHrVag7kSJgV7PqX8dS4ZTVVadJwttyCWjTO 7Nb4pEpf2rPsOkOYQpldWEtq0QEM3J+MOjAIayO7r75xVLmWDbMXefqBNGBULAkscGU3 QS1rI0YWAlRRopFekLwM0iaOVG3A4oqoIl7Ss4TRqMDkFCNRGfDLBlCSZxfe+OWCrW9D E6WmikFOiYD4SDmqV7Sf9XEDQi0LJhc7na6F1NIGh5QMXcuPS5Yx456+58SJiA5YwUpQ ZZ1jtLVJUeLfI/Q00TV3jfocDG6NFhj/IWu/se9tbaXqi8j+K/bq/XoS59ABOIdmExTr obnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dUwpNx8jl1hf6TOp5M1jGy5lUi3QgYGpZi8uH45FfMg=; b=U1XxLL6V72YJstsignnq7SSPE0UksVRhW22qwkbo9pk7ZXKy819B6k63fajAXMBB/6 IRvZ4fS2zw/hU8MTlnJUk0/5wKBXHU9gG/bMpf5+dDbfAbOE59C9Vl6XwC7/cMbOR0iW 6h00vPhIa2Ea0ldNrpxphEvvIgybIcQDOC0xDLkctvSDdLYQKqQw0JCFoQrTA0eZbqJ+ VQZiRKnJ+//LPHC1wM0N5qj7jyawJ33yGMJpZkwn8NwBxWFelSPx2ZDyclfpRt/JFH0X 3fPy6rZ9sN991zJgMi/27sMDPqYq1sBnVuf7vC5oKmWQq6ldzRYZ8K23nQS3xYH+uv4c QusQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nH+8Hgk4; 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 c25si28969818pgm.73.2019.07.29.13.03.51; Mon, 29 Jul 2019 13:04:06 -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; dkim=pass header.i=@kernel.org header.s=default header.b=nH+8Hgk4; 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 S2388827AbfG2UCc (ORCPT + 99 others); Mon, 29 Jul 2019 16:02:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:38692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390001AbfG2Ts3 (ORCPT ); Mon, 29 Jul 2019 15:48:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD60721655; Mon, 29 Jul 2019 19:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429708; bh=WdrHKz/K3QX9mTPzujPiV0e9Ku7Nh1BB4Ow0C7qRfzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nH+8Hgk4Kg94NrjzuqX3AwHqCtEtLmzyLWbuFHhBAcjpZJ8lhf6pYP2iOcPqcQLug 5Xag7r4B3/h8kL9zUWYLsf/Puqx4XoFutpoMmIRdg3QUUE7RcKglYybIePTWq8EVAQ O4CO1wSfDa3BxGBuDS80QcIL8YLvt0DnhvVx34mQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shubhrajyoti Datta , Michal Simek , Sasha Levin Subject: [PATCH 5.2 068/215] serial: uartps: Use the same dynamic major number for all ports Date: Mon, 29 Jul 2019 21:21:04 +0200 Message-Id: <20190729190752.123069943@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit ab262666018de6f4e206b021386b93ed0c164316 ] Let kernel to find out major number dynamically for the first device and then reuse it for other instances. This fixes the issue that each uart is registered with a different major number. After the patch: crw------- 1 root root 253, 0 Jun 10 08:31 /dev/ttyPS0 crw--w---- 1 root root 253, 1 Jan 1 1970 /dev/ttyPS1 Fixes: 024ca329bfb9 ("serial: uartps: Register own uart console and driver structures") Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/xilinx_uartps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 605354fd60b1..9dcc4d855ddd 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -29,12 +29,12 @@ #define CDNS_UART_TTY_NAME "ttyPS" #define CDNS_UART_NAME "xuartps" -#define CDNS_UART_MAJOR 0 /* use dynamic node allocation */ #define CDNS_UART_FIFO_SIZE 64 /* FIFO size */ #define CDNS_UART_REGISTER_SPACE 0x1000 /* Rx Trigger level */ static int rx_trigger_level = 56; +static int uartps_major; module_param(rx_trigger_level, uint, S_IRUGO); MODULE_PARM_DESC(rx_trigger_level, "Rx trigger level, 1-63 bytes"); @@ -1517,7 +1517,7 @@ static int cdns_uart_probe(struct platform_device *pdev) cdns_uart_uart_driver->owner = THIS_MODULE; cdns_uart_uart_driver->driver_name = driver_name; cdns_uart_uart_driver->dev_name = CDNS_UART_TTY_NAME; - cdns_uart_uart_driver->major = CDNS_UART_MAJOR; + cdns_uart_uart_driver->major = uartps_major; cdns_uart_uart_driver->minor = cdns_uart_data->id; cdns_uart_uart_driver->nr = 1; @@ -1546,6 +1546,7 @@ static int cdns_uart_probe(struct platform_device *pdev) goto err_out_id; } + uartps_major = cdns_uart_uart_driver->tty_driver->major; cdns_uart_data->cdns_uart_driver = cdns_uart_uart_driver; /* -- 2.20.1