Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp344723imb; Fri, 1 Mar 2019 02:08:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxfJjrGRP/rIStDkAiL70IfHFaaInBjkt/8y8ms9KrShAUnZ7dEQ7zYgq6js+abhb6SgsCs X-Received: by 2002:a17:902:b24:: with SMTP id 33mr4632250plq.314.1551434929581; Fri, 01 Mar 2019 02:08:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551434929; cv=none; d=google.com; s=arc-20160816; b=KbFJafoNQEEojN4z7kiINGs03/5ZyA/BxVZJt0XLCWi4PZnQ71W2/Zxp5ndzhnt2GL tLhSxRwVXqKDvZ0625KR4J9/Y0gpsf4Scel0QlaM7a24vEBAAKKquFjhsf0XSrh6swpX 4oG1x5Q2SnJs0kttVWWIx8cwYXgqiwJqBQn8PI3hfx4kI0jKx4hy6EwQ0P9eWWUf6PeE ypYvVH9E4UgLnwbSlugpBMqbnmGYKJz/QOoDHbqjDXq9tfWYOAbB3PSBFX0vHQ/AaQuR NBZq7a3AWj0Iu9pKQIrHm9HjCb+iJQmpclPpopI2TghtSvicJsuGjBvJ4h7gACP8I+cm AQHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=lKFc99TszkQPWD0BXLhaOJ/CnMlOpCo1QkwGE2QZKNs=; b=HQciC9zDYlH/l0Evnn5f/JpvSzm70XSrEP9EkBokVLDNsN1PuRcKluBSqw9J3ihdG0 ysP7izvYwewNuCwsIcX0+3CF+U4LaouvFhjhPmQjqAuOXHn/wF7yENqHdkugijDqCtUr N3jtGVXNJhxM4iKawNkchJYiwT85G6G3m+WanCKj/6DHITUESpsJxD6B3ZiqO/jMjoI8 0vArLWSoeGvmzlTNjiucD9EGgwiErSUaZc/nDCqcT7b+1eJVoMkKO7zP0bnTLE7IVoBm rDIguYGRlt4co4CoamrW3uBOaFisnX401buDJk2Y+T5CnQ6nHSMdyjcAf8bCkZdSb1gs Kv7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=fsLaLx6Q; 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 bc4si19674090plb.119.2019.03.01.02.08.34; Fri, 01 Mar 2019 02:08:49 -0800 (PST) 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=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=fsLaLx6Q; 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 S1733045AbfCAJhy (ORCPT + 99 others); Fri, 1 Mar 2019 04:37:54 -0500 Received: from mail-eopbgr690078.outbound.protection.outlook.com ([40.107.69.78]:8992 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727697AbfCAJhy (ORCPT ); Fri, 1 Mar 2019 04:37:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lKFc99TszkQPWD0BXLhaOJ/CnMlOpCo1QkwGE2QZKNs=; b=fsLaLx6QDGfdPNfTNnpQSwaUW5nDzZOwRI5VyMMOK4yXWxNRPVMU2G58H199J1GVPncp4TCB7QkzPlDRslp3OVBB5Mvj70bW2XyyL1h+9acwN1LQjxYy+N0/lz+oVOyVjyy1bY2pnvbIZfW2qlnfZlIFMKLIr+Z4x9CMQi+Z2Oc= Received: from BL0PR02CA0071.namprd02.prod.outlook.com (2603:10b6:207:3d::48) by BN6PR02MB2753.namprd02.prod.outlook.com (2603:10b6:404:fa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.18; Fri, 1 Mar 2019 09:37:49 +0000 Received: from CY1NAM02FT064.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by BL0PR02CA0071.outlook.office365.com (2603:10b6:207:3d::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1665.18 via Frontend Transport; Fri, 1 Mar 2019 09:37:48 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT064.mail.protection.outlook.com (10.152.74.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1643.11 via Frontend Transport; Fri, 1 Mar 2019 09:37:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:57423 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gzebz-0001DO-Sn; Fri, 01 Mar 2019 01:37:47 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gzebu-0007rT-Ok; Fri, 01 Mar 2019 01:37:42 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x219bbiB025540; Fri, 1 Mar 2019 01:37:37 -0800 Received: from [172.19.2.152] (helo=xsjsatishna40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gzebp-0007qc-3b; Fri, 01 Mar 2019 01:37:37 -0800 From: Rajan Vaja To: , , CC: , , , , , Subject: [PATCH v2] tty: xilinx_uartps: Correct return value in probe Date: Fri, 1 Mar 2019 01:37:08 -0800 Message-ID: <1551433028-25207-1-git-send-email-rajan.vaja@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543927882-15091-1-git-send-email-rajan.vaja@xilinx.com> References: <1543927882-15091-1-git-send-email-rajan.vaja@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(376002)(396003)(346002)(136003)(2980300002)(189003)(199004)(47776003)(54906003)(305945005)(110136005)(81156014)(16586007)(316002)(8936002)(356004)(2201001)(106466001)(6666004)(50226002)(63266004)(6636002)(44832011)(486006)(8676002)(126002)(81166006)(4326008)(2616005)(476003)(14444005)(106002)(50466002)(48376002)(51416003)(76176011)(72206003)(446003)(36386004)(11346002)(478600001)(77096007)(336012)(426003)(186003)(5660300002)(26005)(2906002)(7696005)(36756003)(9786002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR02MB2753;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5f5659b3-3e2a-482b-8cb4-08d69e299131 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060);SRVR:BN6PR02MB2753; X-MS-TrafficTypeDiagnostic: BN6PR02MB2753: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Exchange-Diagnostics: 1;BN6PR02MB2753;20:4G8l6+A7QZ6jKfZF+MSRe1eTe91dfkm3nKcwUUHaNx/cu4A33Ynji/wKkoW3iSfPreVeELbUSczgDZhUekMG3kxO9AjmH1tn5FDqp95rDRK9ZxEYuKM9u/xOm/xy/9380NEGQXrovmNvcQbUPYClEX4hm4FMdCRYJf7s1PousHJtsLYIuDexHQmKxL57TWcz9LptV8HT9kTsNEAggqi9O9+IL8DTyrnbM2fNBLFNGQ7J6D3nQK+LseUbPs97s5mBm5RMXaPSfkqCVVsXiWUVBSxA5e/JA45GnA0eC9fCw0pKVgcjDWMJ4hQQyibYgSeoWBZbyZ2SqUkG7kp4mOc8MTZIjND+k23O4Mid19buUJtq7zCfftXobXgNph99XrXE8lHKrDTTH5Yg5rQ3HAO4mjXnAQXngWXq03Q217W+i8vKTdtdlnCu32hkHGCee0PWHy7FBLFfHCNUUUKpjAb+xaBRDA7mRJDmI6rq6m4uJEBouIKwEaLLYpGR9TnDlg+B X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09634B1196 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR02MB2753;23:+oJfQsy9bXgQA9lYfAO1o25ssSuu9LfJ3/l2qGzmK?= =?us-ascii?Q?oNvMrTOmNJx8SC1AJdApu28oyF4boAUAJ3KwqptwrJiQC7ByJXgtqWNgd7xS?= =?us-ascii?Q?Ee4lpKs2Rs2ABEmAYa+Hd6Ij5O4mW+yLaDD3du2eXT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BJBt/99E+U6id94IuqAV2L0Rpp0X/7FntPNmZ6Q1L5160IuS?= =?us-ascii?Q?Zyw+iRtSrXXXF6TrH6Hmz2QrkpAy1pG6AGcsq6j4/J2Bci0OpNs+GK/h45T6?= =?us-ascii?Q?5uirvowKLIRvBngjpJ+HTkGCZtV55msS8YkbeTV0vx2z2qf6Yod4EqsSNhCJ?= =?us-ascii?Q?DPBd6VWPSIUN1lPduMrVXYB/pKd2hx/Zc6p?= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: qCuNd6tsJxgUGP4zfu8oVV7HXuqDY/CMRL2ToSbjvGsNUUDU9UL5+eNHeiXKs0zkQ5vlV02W7xaLD9Onh5r+QV1bmfe8WuQ1U+DPuwI/e9O2IXIA+mkeVcmvWWPW2vMm/JtrUjHaDmbBS929lE2KtX7qTuPrdp85S6hAX/x+FvqRqkj/nggIsCGul0G5/itNNE6LB++NT8U7HfXWXFJ+NhWGjxTVhLrwdB4NNt7TfnV3P1AnBWCwcl2NN2kDJs9P3Hc5IqulxbR4v9TcLSQBzErPbQJU1IkkV6Hp5jXjb4ERPvRjwvEPSqurpHuLjllQewV0EXalO3TZmOIuJU1wqoBuqS6+9nZPRaos+flXF8fpTc5TaXqQjZnZZCaY9XF6xJYFSKrs2W3iPO0QaAH69qBgCZzlo8B2r5vZFCHKv14= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2019 09:37:48.3364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f5659b3-3e2a-482b-8cb4-08d69e299131 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2753 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Existing driver checks for alternate clock if devm_clk_get() fails and returns error code for last clock failure. If xilinx_uartps is called before clock driver, devm_clk_get() returns -EPROBE_DEFER. In this case, probe should not check for alternate clock as main clock is already present in DTS and return -EPROBE_DEFER only. This patch fixes it by not checking for alternate clock when main clock get returns -EPROBE_DEFER. Signed-off-by: Rajan Vaja --- Changes in v2: * Handle dynamic port allocation error cases --- drivers/tty/serial/xilinx_uartps.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 094f295..f7ae73e 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1547,27 +1547,33 @@ static int cdns_uart_probe(struct platform_device *pdev) } cdns_uart_data->pclk = devm_clk_get(&pdev->dev, "pclk"); + if (PTR_ERR(cdns_uart_data->pclk) == -EPROBE_DEFER) { + rc = PTR_ERR(cdns_uart_data->pclk); + goto err_out_unregister_driver; + } + if (IS_ERR(cdns_uart_data->pclk)) { cdns_uart_data->pclk = devm_clk_get(&pdev->dev, "aper_clk"); - if (!IS_ERR(cdns_uart_data->pclk)) - dev_err(&pdev->dev, "clock name 'aper_clk' is deprecated.\n"); + if (IS_ERR(cdns_uart_data->pclk)) { + rc = PTR_ERR(cdns_uart_data->pclk); + goto err_out_unregister_driver; + } + dev_err(&pdev->dev, "clock name 'aper_clk' is deprecated.\n"); } - if (IS_ERR(cdns_uart_data->pclk)) { - dev_err(&pdev->dev, "pclk clock not found.\n"); - rc = PTR_ERR(cdns_uart_data->pclk); + + cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "uart_clk"); + if (PTR_ERR(cdns_uart_data->uartclk) == -EPROBE_DEFER) { + rc = PTR_ERR(cdns_uart_data->uartclk); goto err_out_unregister_driver; } - cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "uart_clk"); if (IS_ERR(cdns_uart_data->uartclk)) { cdns_uart_data->uartclk = devm_clk_get(&pdev->dev, "ref_clk"); - if (!IS_ERR(cdns_uart_data->uartclk)) - dev_err(&pdev->dev, "clock name 'ref_clk' is deprecated.\n"); - } - if (IS_ERR(cdns_uart_data->uartclk)) { - dev_err(&pdev->dev, "uart_clk clock not found.\n"); - rc = PTR_ERR(cdns_uart_data->uartclk); - goto err_out_unregister_driver; + if (IS_ERR(cdns_uart_data->uartclk)) { + rc = PTR_ERR(cdns_uart_data->uartclk); + goto err_out_unregister_driver; + } + dev_err(&pdev->dev, "clock name 'ref_clk' is deprecated.\n"); } rc = clk_prepare_enable(cdns_uart_data->pclk); -- 2.7.4