Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3608008pxm; Tue, 1 Mar 2022 01:36:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxaYwk0knPHRHUZJYrcyVtvhwGJxWH+ZNoL6Hq5G4kOWpjJZCYhR/RHDtOqz2X7nRzapnUs X-Received: by 2002:a17:90b:250f:b0:1bc:e520:91e6 with SMTP id ns15-20020a17090b250f00b001bce52091e6mr21300533pjb.43.1646127387203; Tue, 01 Mar 2022 01:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646127387; cv=none; d=google.com; s=arc-20160816; b=nStQRI0dWTwEQQaawZl4R7Iyova1D1clCjqLBTcp3E586HLqJ2IblWDA7JrCwaJqUX wWmXtI3Jfu9qCi065bxkte4OJ58Ykizvb0HWYX/XYDwW9RZlWnPMi21e6LRba6iSgpjV 6SFl5LwTEPbBYlgs77hlUqe2zrY/5nezsvzPFBzV0Z0vyR5NzJAIkLG3a2RS8IjIXAPE wdNySAk1cgNKay6c53kQyUbXl4ti3McqmuNXL/6xgbAcCWuTSmf/CJuxghPNKRWESftm 3h+Qpr9gGeG2vi1+f6lrLI+D7qA433dWTpWMljlYC/JXBRPB6lWxMf2sCJCnFW2z3kyy cAQw== 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=JhiVq8gCXhSxVaGO/xJ7PRkI9QnVfC0o+aaLtys31/uXmX52rSF8SyQNGLmlc4ziNP s8vQWw9kgUS8SrzNgw9X4jeZt96ZrZs9+8kK84DIENxUYiSx+zMVzTqkSrTLwTlxUan5 wn7z/fHu6wNTJFF5QQ3PU70cqdiwUutoHA08l6onU0qifiHTSZlGI+DrZq2CtVCMubKY A0qMu7lJKKbQ3I40Rgg7b/0b3XaiVIWZunru1GhoPY2387d6Ko4ArntwdKSNyfTidxc0 nchmv84vCoAJ+0eFUDV0imLrAePP4Yd5sYh1qiIOKUK5UJa2zly4p0OQCjtYUheej7RI hztQ== 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 c1-20020a6566c1000000b00378dd95c40fsi1996741pgw.333.2022.03.01.01.36.12; Tue, 01 Mar 2022 01:36:27 -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 S232333AbiCAFfP (ORCPT + 99 others); Tue, 1 Mar 2022 00:35:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbiCAFfN (ORCPT ); Tue, 1 Mar 2022 00:35:13 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03E770CF3; Mon, 28 Feb 2022 21:34:31 -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; Tue, 1 Mar 2022 13:34:28 +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: Tue, 1 Mar 2022 13:33:44 +0800 Message-ID: <20220301053344.29171-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