Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3008436pxm; Mon, 28 Feb 2022 10:11:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzf6CKfgMumN4XKnuRr9iq0bhWd9pMGsiDbjadTa7mANx89rur8q3eNZOIyTN089qmuk5QM X-Received: by 2002:a05:6402:5c9:b0:412:e7f8:81c3 with SMTP id n9-20020a05640205c900b00412e7f881c3mr21382018edx.386.1646071880665; Mon, 28 Feb 2022 10:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646071880; cv=none; d=google.com; s=arc-20160816; b=F5UJsvYnvpiLJZlkJ8zWEKgMzQLYy/KBeay6GqRLS0HyS58ZjkUeY/tlP+ooivz2rN iQBuLT15asbQnv0S0v+tuZ287x0dCB54wCo/5wQrcl+xQc2Dksgtn4hEgVUb5YgiXOk2 EEXxAGopgsI/57HjPjJPhlzfhJQBq5A1TOOwMPYKgDWA9u8siNjfkZ5J67Qfog7vj/+n SHWVCrCIaZ6aU8X7lLcjrVQ89CFreqs2WbfvqKQHR1jahl+L/IrKOC3Jk2PFuzpKOfPy dz3f0TzSA0d8eBAzZ2GO7wxkYLyMKnn7WS/RnKtq+WNea/WDx13JvC6m6CGtbO1dzVy0 LNIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=OZcDRG7vIJ1stU/czNKtICh4zzF7+bW8xHozDuo12Ms=; b=zgoejWs37t0N4UrHsnVurvfa1+22t7JauVyoO/20R5JvL3VnmpdyKSptsujltjZx7k UQjCdMWeR9dG04pgTsTGT30cHvUZIK+d4JQAqUVggAS89D2jOt5sUiqpCDrQ1Qbi3zYJ 3XoD1917qkVxE1UMcJ+KIWsvVuBdnzDqmCU+JoJ2DMHGD0rSv3Nx4qYRcwVID3x8nS0T eXHi/wV7y3nNa99mIdyAQ28uYOHcYR06l3ABTqnr0pfrl5+d/4REbOXqa9RVt4XP92+A PpqdOCkAiIsZZuTPn/BqM6ayt4rz+7N+JC4725hLCXeP2tq1u6LlgCJ0GZGjrGJeeNR3 HY+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a1709065d0100b006cf37fdb0cfsi10715628ejt.936.2022.02.28.10.10.57; Mon, 28 Feb 2022 10:11:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235958AbiB1N5g (ORCPT + 99 others); Mon, 28 Feb 2022 08:57:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbiB1N5f (ORCPT ); Mon, 28 Feb 2022 08:57:35 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F847D007; Mon, 28 Feb 2022 05:56:56 -0800 (PST) Received: from droid06.amlogic.com (10.18.11.248) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2176.14; Mon, 28 Feb 2022 21:56:54 +0800 From: Yu Tu To: , , , CC: Greg Kroah-Hartman , Jiri Slaby , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Yu Tu , kernel test robot , Dan Carpenter Subject: [PATCH V3] tty: serial: meson: Fix the compile link error reported by kernel test robot Date: Mon, 28 Feb 2022 21:55:30 +0800 Message-ID: <20220228135530.6918-1-yu.tu@amlogic.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.18.11.248] X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency. Fixes: ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frameā€œ) Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Yu Tu --- drivers/tty/serial/Kconfig | 1 + drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index e952ec5c7a7c..a0f2b82fc18b 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI config SERIAL_MESON tristate "Meson serial port support" depends on ARCH_MESON || COMPILE_TEST + depends on COMMON_CLK select SERIAL_CORE help This enables the driver for the on-chip UARTs of the Amlogic diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index bf6be5468aaf..972f210f3492 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev) return ret; irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_out_clk_disable; + } of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize); if (meson_ports[pdev->id]) { dev_err(&pdev->dev, "port %d already allocated\n", pdev->id); - return -EBUSY; + ret = -EBUSY; + goto err_out_clk_disable; } port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL); - if (!port) - return -ENOMEM; + if (!port) { + ret = -ENOMEM; + goto err_out_clk_disable; + } port->membase = devm_ioremap_resource(&pdev->dev, res_mem); - if (IS_ERR(port->membase)) - return PTR_ERR(port->membase); + if (IS_ERR(port->membase)) { + ret = PTR_ERR(port->membase); + goto err_out_clk_disable; + } private_data = devm_kzalloc(&pdev->dev, sizeof(*private_data), GFP_KERNEL); - if (!private_data) - return -ENOMEM; + if (!private_data) { + ret = -ENOMEM; + goto err_out_clk_disable; + } if (device_get_match_data(&pdev->dev)) private_data->use_xtal_clk = true; @@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev) ret = meson_uart_probe_clocks(port); if (ret) - return ret; + goto err_out_clk_disable; meson_ports[pdev->id] = port; platform_set_drvdata(pdev, port); @@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev) meson_uart_reset(port); ret = uart_add_one_port(&meson_uart_driver, port); - if (ret) + if (ret) { meson_ports[pdev->id] = NULL; + goto err_out_clk_disable; + } + + return 0; +err_out_clk_disable: + clk_disable_unprepare(pclk); return ret; } base-commit: c2faf737abfb10f88f2d2612d573e9edc3c42c37 -- 2.33.1