From patchwork Wed Jul 26 10:54:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Ming X-Patchwork-Id: 706939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1B51C001B0 for ; Wed, 26 Jul 2023 10:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbjGZK5U (ORCPT ); Wed, 26 Jul 2023 06:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbjGZK5U (ORCPT ); Wed, 26 Jul 2023 06:57:20 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2127.outbound.protection.outlook.com [40.107.117.127]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A98449B; Wed, 26 Jul 2023 03:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O4svG8MdvNaECJIzRwcnEoSbGoL5tt6Wg2s0lM2/wqKGRK0V8EVMDkntGM5YSaN4uZsGCF7wtsJYMU2OLT3KKKq5HsjxA2Db1pWSdShAd9w1oUVuw0v8zxlqfUhM0MtuOpzc/7kOu/8W26IT6UKH5HGUjt3FvB3SedJGbyqm/WUEAG8rHvuL1ftJWxn+lBqvyyDYQEovN5OH/KydS+4hTHmc28ltRSmmKonbEAfQPgyxrfdO9wVurIFv1hUO6l4c2Y9JqaRITN8QKUJ2z+b6mCC1Q9aoH9PEzPA+zcU5JJHo7ot8SqpvJQZbKemDAp5LG+p0Bfd+PmDCJ6xy+NqhUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VA3OdibARXaIYIcYP2wvlLIBQKayyt6/79OzY4lzS9Q=; b=P2PrdZbERfC7HYmdy0H4AErdSm86oW+d7XpLKqaWZvHJHCUS5ckZKrw8UJYMCj/TqIKVWEo0zJxD/lcyIjWrcxUgkaO27Em5vaHqXexeB/a0tPwtyEpIrOjUvDj34Zt+aKem4Y0pbOAMTyfDeFMybp7pPCRVc65UruEUqLuUghbL2BS7g/HqOE337iL7pt/M7xqgFIGKBERChcwJbvF4s8gfcYsDrbh/+4Cli2OyIh79HdmQApLkFg5G7yR2hYCOV9svIheCHXpJ4fOD0lGNnRigreE69xoeKxcwabhtRXn0eakS4wvpW26+kcttAVueE6ecK0zRZe2eUsudkOeSWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VA3OdibARXaIYIcYP2wvlLIBQKayyt6/79OzY4lzS9Q=; b=SXOmhASIDJAEtTbQXosFSqmpiiJpqwhsLSjYXZ/gM9s2IIZJuYDvIdSxH7k5T54U0U0b4C6ubHldZhdmVBj2vDNS5GUY1iEerY0/MFhTSlABN0rnmBo4XZTMzPszXD5TP6Qicmaf8J5ASyan/QHALeZZOso48TjyxWfE6Hmw+esZss/fF8kELbV5XW6sQELuST5B/JCWyjxilwVZli1YnftCHU/SBe2AjrRfxq4s38ne4J4LH5F2X2BlniluxKPxt+o9GrYts8wMVZ8+9+kO2X5s0Fr857Bzk55L0z/UbJtKNsqvXkDbIJ6pq2Xy6alZPXdM9Uy/F0QniysMg9MU9A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from PS1PR0601MB3737.apcprd06.prod.outlook.com (2603:1096:300:78::18) by KL1PR0601MB4161.apcprd06.prod.outlook.com (2603:1096:820:31::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Wed, 26 Jul 2023 10:57:12 +0000 Received: from PS1PR0601MB3737.apcprd06.prod.outlook.com ([fe80::74f9:2f8c:e5b8:a573]) by PS1PR0601MB3737.apcprd06.prod.outlook.com ([fe80::74f9:2f8c:e5b8:a573%6]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 10:57:11 +0000 From: Wang Ming To: Mark Brown , Florian Fainelli , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Wang Ming Subject: [PATCH v2] spi: Use dev_err_probe instead of dev_err Date: Wed, 26 Jul 2023 18:54:47 +0800 Message-Id: <20230726105457.3743-1-machel@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR01CA0166.apcprd01.prod.exchangelabs.com (2603:1096:4:28::22) To PS1PR0601MB3737.apcprd06.prod.outlook.com (2603:1096:300:78::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PS1PR0601MB3737:EE_|KL1PR0601MB4161:EE_ X-MS-Office365-Filtering-Correlation-Id: bca18843-d94b-45fc-2edd-08db8dc7101d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n4at5Wrqz5V7uTHpVMQija3PbVPcRzaAq/poiVA91tyziamXVNN2s69vyBhlZPw6vjcygtOiWD9rgGPJr989mpt52ekYJoAVIenQdPJ1KZq/d7LiG+TxOQw0xHKKc0/c03I9GcKlNz1YSHJC1/viQHJ8kfg4TFqryuzd/RhCTJRs1YdSyUfWJV0BMNDIYRteK1oTNk9PeACauCIW5Bl0W0ZtCfOqY/KlwP/PYO6SAMqliOIMJ8IRzkn4dRhE6czka196D5rR/FrdZyR2sbV6f8LB+NriUpwCR4OLWQnQzTBGfYaSHVUzoaTILOXRpuLw4cRPTL2c1fJhR6TIa1BZq3FTCRkj4F0C1B23tpCOqF7JUe3uyE/unHU9/nac3JP9Ok61h5OzuqkRPzB2OuZ+0qlLQ1DzVlAHM0OiWUDY6Um716lvbLgim3JtBo21UJR9v0e8UXrKREYIr4iQ9Kc7APi4+L5XPlnjrKxJTOGpQYPbyZJU20Uf8voIAjz2WWAkZtVrg090kfX7fcNDW8lLBHC/6sp47Xc/ZmMr3/LLteophgOlEgz/YZA2fNaPGIfCA8HcpfJgXQzdbfWnVBW8V9l25dIc1zZK0tlhcb+1qErQHLVuazTxSudqMP4FnDcx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PS1PR0601MB3737.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(136003)(376002)(39860400002)(346002)(396003)(451199021)(86362001)(36756003)(2906002)(83380400001)(186003)(107886003)(6506007)(1076003)(26005)(6666004)(38100700002)(6512007)(6486002)(38350700002)(52116002)(110136005)(4326008)(316002)(66476007)(66946007)(66556008)(8676002)(8936002)(41300700001)(478600001)(5660300002)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ODlC68Hw+EqQ2A43kFACOGZJErcxyEdRRNc9Ziu7Tid7fzY8uTVbX3fFWjnwrx7lPHum5l+8+MOkfo4S1UxXcqIWiOt69egBCW2jTR8ZIIYnTEp4BS3HXRtQyUOofCENzojRz4XLeURBiSKB2QF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bW9s4OL8xrlmo55RfP0cfr2eFFmMEdqgFk0b43PiCtnBhP+xJmnPMOGYIGcmuRon5LB1xpHQ43DxDL3caDPQzZx25xpjjb3DapXQeeRq621nGWaGuUntKeHVKHznb0mek2vaHm4bokV+OEXhvVYQ6b05/3piO+JU8T4Kakrd5UUcoV2c6YoaHMvV4IdRNSL9wD8YMcSmbLRGgFjVIJDvj1LgSkMVWpndNT3pLmuy3/Ha12iiMK9oPKzpB9GCnTvvMVXzheAsGKsgrxd69b/Brk9HWP61ztY8G7AdSFQTYkwx39hOL9miuY2eWoTd+/cUdiN1OSr0cqJCItwKcRCJ+Z1fhTzGU8jU343+KfL9WjCL X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bca18843-d94b-45fc-2edd-08db8dc7101d X-MS-Exchange-CrossTenant-AuthSource: PS1PR0601MB3737.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 10:57:11.3568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VZErqLtdI1VM/0JgJtdvD52S/OVSr0lzZlybb6SZji+owxDTZBAQPp59jzB/12fR1OwoG4gmHAyycoGPLjNbKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB4161 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org It is possible that dma_request_chan will return EPROBE_DEFER, which means that dev is not ready yet. In this case, dev_err(dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming --- drivers/spi/spi-bcm2835.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 3b253da98c05..cbf025054c96 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -903,15 +903,15 @@ static int bcm2835_dma_init(struct spi_controller *ctlr, struct device *dev, /* get tx/rx dma */ ctlr->dma_tx = dma_request_chan(dev, "tx"); if (IS_ERR(ctlr->dma_tx)) { - dev_err(dev, "no tx-dma configuration found - not using dma mode\n"); - ret = PTR_ERR(ctlr->dma_tx); + ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_tx), + "no tx-dma configuration found - not using dma mode\n"); ctlr->dma_tx = NULL; goto err; } ctlr->dma_rx = dma_request_chan(dev, "rx"); if (IS_ERR(ctlr->dma_rx)) { - dev_err(dev, "no rx-dma configuration found - not using dma mode\n"); - ret = PTR_ERR(ctlr->dma_rx); + ret = dev_err_probe(dev, PTR_ERR(ctlr->dma_rx), + "no rx-dma configuration found - not using dma mode\n"); ctlr->dma_rx = NULL; goto err_release; }