Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3702099pxb; Mon, 24 Jan 2022 15:47:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKzEYKwPoKyah5tWbSnLcgNSilysMFCcK3cZgYi4ETERsIYlQ0+n5A9LEffqlzo5cQzdiR X-Received: by 2002:a17:90b:2252:: with SMTP id hk18mr698083pjb.53.1643067967324; Mon, 24 Jan 2022 15:46:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067967; cv=none; d=google.com; s=arc-20160816; b=EzIYeiyFzNlGte1JvC9/02Agx8YhvLXNwJGTnlFQZ45iomWUhdEKQDAdCcyZ4tE1DH zq3LlPRfMimtVlgqpmW4DiHbHYJL1eU94f2zkwyI6bp7gYHw6Yzzbmie4ywPVMRK6Xwr BiWYjrVhdCmra4J3MdVcQri8JdBiA4vf0YCP8rrXeWxTK1a5Ezn95hLgVEt1Dvx3jqdU heFejq3fYKjNYiR1GOYcgjWUm2kH4bVpEhn6ccGnwuADrHNllPqd7F3JRS09s8poN1ID s/IPRHb2+Yj/C9JGM5TPZkRhnWGdgrvh9FDVTJlhmjcl0gdokrUB7CN0caqpuEo/cx8H 4BYA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HUXmYFjN+t3FjiCCSyyDSrC8XaZ29VS2EtbnqWNyUcQ=; b=d7Q3obebytVasrcj9s722tXbGyoMbn55eu8QVuVFiN22zfQnK4IheyLtvA6l/lhK3E H12qQKtLlKS4sHm7JkIrxCt0+kfR3d9jWYvzfRlsT9CxCcdjvRpqqMz12fMH3zmXGxUJ CiZPaT5gbKs0VocWmt59uGlCLo88+jJ9otsnGdBcuASItoVU2yJUSuPinKKxyD1Imcls jFv7Ba6KuIxAvx5rBBm3rDIl1L8d23OP7475o7+6KxUljw05MpTE+1X+fzQ75GGFsgy9 OxKpEh02u1ocle4vqWWibTChI9fZbscJcCF4zLCMxOGGPFZo5cgfWnabTlF9k/1Cm3V6 9jjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y143Leyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n37si16753877pgl.324.2022.01.24.15.45.55; Mon, 24 Jan 2022 15:46:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y143Leyq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2360601AbiAXXhE (ORCPT + 99 others); Mon, 24 Jan 2022 18:37:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382589AbiAXW4E (ORCPT ); Mon, 24 Jan 2022 17:56:04 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CABBC055AA5; Mon, 24 Jan 2022 13:11:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1B42F61469; Mon, 24 Jan 2022 21:11:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCEE3C340E5; Mon, 24 Jan 2022 21:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058664; bh=2BQlgnQsNwEwfMzcRqMA7YHREraPyfZU8xrRYkLHLTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y143LeyqjIO+aQNMWbs3xBKNlT8WooTvoQxFGMfLanofKX0DfidKuOrpYBhCUsV83 77ycAYuG0EYeS0UluziiosRXDN6v1tR0uLEDOqO0aRXzfWRPyJwRj+YCpBP/mKOHW1 6uUNbQn8JQwFTnJtS8wrUBadC2ewaLQf/gTmVJiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Florian Fainelli , Lad Prabhakar , Sasha Levin Subject: [PATCH 5.16 0362/1039] serial: 8250_bcm7271: Propagate error codes from brcmuart_probe() Date: Mon, 24 Jan 2022 19:35:51 +0100 Message-Id: <20220124184137.453861148@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lad Prabhakar [ Upstream commit c195438f1e84de8fa46b4f5264d12379bee6e9a1 ] In case of failures brcmuart_probe() always returned -ENODEV, this isn't correct for example platform_get_irq_byname() may return -EPROBE_DEFER to handle such cases propagate error codes in brcmuart_probe() in case of failures. Fixes: 41a469482de25 ("serial: 8250: Add new 8250-core based Broadcom STB driver") Acked-by: Florian Fainelli Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/8250/8250_bcm7271.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c index 5163d60756b73..0877cf24f7de0 100644 --- a/drivers/tty/serial/8250/8250_bcm7271.c +++ b/drivers/tty/serial/8250/8250_bcm7271.c @@ -1076,14 +1076,18 @@ static int brcmuart_probe(struct platform_device *pdev) priv->rx_bufs = dma_alloc_coherent(dev, priv->rx_size, &priv->rx_addr, GFP_KERNEL); - if (!priv->rx_bufs) + if (!priv->rx_bufs) { + ret = -EINVAL; goto err; + } priv->tx_size = UART_XMIT_SIZE; priv->tx_buf = dma_alloc_coherent(dev, priv->tx_size, &priv->tx_addr, GFP_KERNEL); - if (!priv->tx_buf) + if (!priv->tx_buf) { + ret = -EINVAL; goto err; + } } ret = serial8250_register_8250_port(&up); @@ -1097,6 +1101,7 @@ static int brcmuart_probe(struct platform_device *pdev) if (priv->dma_enabled) { dma_irq = platform_get_irq_byname(pdev, "dma"); if (dma_irq < 0) { + ret = dma_irq; dev_err(dev, "no IRQ resource info\n"); goto err1; } @@ -1116,7 +1121,7 @@ err1: err: brcmuart_free_bufs(dev, priv); brcmuart_arbitration(priv, 0); - return -ENODEV; + return ret; } static int brcmuart_remove(struct platform_device *pdev) -- 2.34.1