Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3602438pxb; Mon, 24 Jan 2022 13:16:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9hWYeUnH088KntO0XE6jaga1BHzt6nP5Arl5E9sJG1/cbKTs1VDtz27LkH3cS+QyoAKr/ X-Received: by 2002:a62:3804:0:b0:4c7:373b:cb2 with SMTP id f4-20020a623804000000b004c7373b0cb2mr15497105pfa.50.1643058977716; Mon, 24 Jan 2022 13:16:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058977; cv=none; d=google.com; s=arc-20160816; b=fk5fK8cIE4CzAHotsXeG9b1koXgxtc+Uk9Weop+Zg2fzsQj7lHXhGNgknMlCdjsXgg ac2YBXb8wMz+QrOYK0GlLoqEo707bsBfR5nWZTQiM/GcMhhbt1GGLR8qgz9arV/0fvbV zIYNzh1OwAFi8BzVHgszRLN65ySQNbPxgmh2LWc6XxoxvBHL+OkDpUnedKy6taYoDtby MRRC/vgJE4Yn4iLraH9g18ltN67uafye8Trz+q50QFlDwnmfm30CBlIb2e2LpztDx3Cv jaSZACno/mUvdRhlY/tPSqsL5qyQd6wVV8Ab1QCQEb/7ckLD3ZddqZOJRlM8ae/V31O1 P6cA== 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=bRZMKAJPOfO5e2on3LoGYnAj617kNRaieNjaB6BkpOKIbvpcQ8venbjx2mkDHK5zYk /byR1nut5qmx25EV+fbXg252aBGPFBX7LSajVUilLfzMNoxt0ZfVJyMROUmcajVzUKTV FsmPAmQWmXePhpBlzZZFiD4VosKDWjyh8EpHdaWAmIi/59UTvOgNFZEsuoXkUloodM6p E9wcaWREMrck8ir4tUPi8brL4x0cu1MlSjYZycvgfAF6dNq2E1RhFAr5Uj3B4wtSmgxL urMD1CVzpvoFU02BxaNOGhY9T6T+kNUHZ0KWFj7MtWOTlN8AbiMoC+LDOvm2BZEnlYiF Uy7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yRiNHgld; 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 4si5840546pli.66.2022.01.24.13.16.05; Mon, 24 Jan 2022 13:16:17 -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=yRiNHgld; 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 S1357973AbiAXUsw (ORCPT + 99 others); Mon, 24 Jan 2022 15:48:52 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33322 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381903AbiAXUYv (ORCPT ); Mon, 24 Jan 2022 15:24:51 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id 7FBA7B8122D; Mon, 24 Jan 2022 20:24:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8A64C340E5; Mon, 24 Jan 2022 20:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055889; bh=2BQlgnQsNwEwfMzcRqMA7YHREraPyfZU8xrRYkLHLTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yRiNHgldUO/VVSXDFHA06Y2Yji+DGCYi5sNDFrB/e8tvjkWf9oovMkgGDeFQDcjNK +VA4agv0GB7D8Qtx1tcYcwV6mUyLXsME7w9nSRr7UNxHl2y/5fh8GU3z3yzBTQazHT Mah8KcEaZjJgoBIY+/9ioorcCYqgIEBDz/n8AWks= 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.15 300/846] serial: 8250_bcm7271: Propagate error codes from brcmuart_probe() Date: Mon, 24 Jan 2022 19:36:57 +0100 Message-Id: <20220124184111.259530397@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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