From patchwork Wed Jul 26 11:51:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Ming X-Patchwork-Id: 710046 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 ADA19C0015E for ; Wed, 26 Jul 2023 11:52:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233761AbjGZLwZ (ORCPT ); Wed, 26 Jul 2023 07:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbjGZLwY (ORCPT ); Wed, 26 Jul 2023 07:52:24 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2124.outbound.protection.outlook.com [40.107.255.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB897E7; Wed, 26 Jul 2023 04:52:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mVTNfskbXGbeo+jrwAOM3aNL7xe2WJxP4wBP33zVYYCrKF6X7SrGPJ7K8eXmUfn/JwaNLKoFNsjNgO0EreI0rCRVUA7jfb1M+6n7UcvfT/0pnOZr4YbYQQnyA4lZ+FBIzILRwtpqn2DmKHHTy0Z4R6+BCA85+5JH3VYZJWHtfcApua2fOjIQm2Rg7UAR9NO9gxroOi9k8xnr6nKiMEhwjyAzwDziqDLF/Se8fkg/4a2QisAgnLR7ePMztK5keJGVAbPtO3Kk3JGaUwP1hYrolyuCJfmuOqPLTg6M6iAG3Pfua+vWmZDDXLGEl6eFgUphksMUOsxHpf6alhsoE1NH5w== 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=gPIfR+C/5OvNI7ixKpo7QSJI2PTeA+Ef3zQfAccD1YI=; b=OpfNN7HdNEhUgEuWV/9cI3bzyBlu3E4sFrwAG95zZAgBO8yRpHv2UrvAs2Ro1Zv6+QIJ0Ddx7I6ROITPRnVXC918z4ruW3Rj1PaJJ22jMCY5R+mZpp3IdIukftRl2DdXgIS+qV3tUrOgqT638NRUnookmjhemmnVvz1GNCUE7dZztqV7RijcAtB67pmKB7Zk4A/kmfNKUkz1YE95CRoLnlLq0rNuLPHBgH2BgYdbEc4YOi5mvAhoc5Bu1puaQSDX8VN7OI36NWQLczC9GUEg4i1zZLdArMPUsrl/wXlZml+89Y0qGQa6cfpEqbgbSC/FuwHq9YrDgoWtFbFiDHZm8A== 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=gPIfR+C/5OvNI7ixKpo7QSJI2PTeA+Ef3zQfAccD1YI=; b=KGUEhQoWVi/EmeXtqDEPosth7Dp8XoH1q5hVjL2eV+J6TPAS1mhPLKbzjqcyFoOGgB0faF6QmtdSrMOPy66xtZKYyIXGJd1zFvpXkRuBqhbrDtPOW2ObA6VMuu7AOHec5dkSPefX3nTAlGU1ynrBbalaPRWlX5bHTxPfiYGkaHmiW2A924psoTqOUkfuE2qQUGeRmpeO85nmPYKeS0lgpNh3UEr8pBonnBAx1T2MykG9akVFnjV+vJ/xvHp7m8ld7mvzlHhI2DHADIysjMGLOjIbuEpmchTJh/VB88UBLVWTebL8lclMldNoDDQmab+oRw7rY9WNrNkTCdLsx5NhSQ== 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 TY0PR06MB4984.apcprd06.prod.outlook.com (2603:1096:400:1ac::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Wed, 26 Jul 2023 11:52:19 +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 11:52:19 +0000 From: Wang Ming To: Laurent Pinchart , Mauro Carvalho Chehab , Michal Simek , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Wang Ming Subject: [PATCH v2] media: platform: Use dev_err_probe instead of dev_err Date: Wed, 26 Jul 2023 19:51:58 +0800 Message-Id: <20230726115208.5463-1-machel@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2P153CA0018.APCP153.PROD.OUTLOOK.COM (2603:1096::28) To PS1PR0601MB3737.apcprd06.prod.outlook.com (2603:1096:300:78::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PS1PR0601MB3737:EE_|TY0PR06MB4984:EE_ X-MS-Office365-Filtering-Correlation-Id: 800a45f4-6f17-4700-28f1-08db8dcec3ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zyL3QrTmVEJ4nJHjCegLUhsymWlC8yK4OJI+uGVz8mCLXKOtP3QM+3DDt4fgGlQbnHTjIZ6h6YSm9EXv2yuVWNw3Q7SDN+f7xgsce6YUZt0bWj5t6XtGVv4qJlplh8isS5LoKCLfWXe22DZrIOogK8v0YQ86uDxHUqv/kKVhRHi/78Yjgqk8sTgj6UNS/IHP+zCgQOeD6FuFb33Qo4/sJulQmFG6tmqJrubyPxXskQh54OEM/VqQIt1JfQchomKEZcQnlr7z1fK9yQABEHqsTSOVXbWFjdkwF1CCThXnI5wj4QWGiRdpZN3c2QV7pqT3tttOOAC8fcUICMswtJLqh4dUfPPe9bPoxIWQsqCQiv2RNuBXO2+Ceo2fLfI6s8dzwtkOTOoZhnfOUQVQ0hv1Ef/472VF5QnrAU8pDO8T3NwjI10Fim5q/f0+zjMaQZJEIUEX0tQey6DzHiBxPYhPclrI3zKVTKhCmPNQGoUpgYenCSAVjrbuptxWeIpTMLETo5FGKeVhO2iOdHg8BgqLQV+Xw6oodvzYmdmub+CLoOCIKoI4paOfffcP2+gSyguHB67NIp4LLgz73z54SbGJGmT3T9JCptrDMcJRO6e4VCGZlqo9A6l7JvxmQF/vW/PF 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)(39860400002)(366004)(376002)(346002)(136003)(396003)(451199021)(6512007)(2906002)(6666004)(8676002)(4326008)(66946007)(6486002)(66476007)(66556008)(36756003)(41300700001)(316002)(110136005)(83380400001)(38350700002)(38100700002)(6506007)(52116002)(1076003)(5660300002)(107886003)(86362001)(2616005)(26005)(186003)(478600001)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nNs1UkIJ+lI4KTT7tXg31WaAtkreUjJLfr7RchVp1om1/LrJ3DHWwpjmrRPk3yGmIItKRs2X0/eaiuX4lBPoOT9mwSUjLQLyund8GUjXSSifeqnK0w2Xbhi3LnWt480Re62ayVLB5vdjqZNe26s+UbaNZNnTjREScI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yoDEIqSMfyYCms/6nbnSHlBINd0pW87XyPM+oO9GiDHJeQY1Ib2SgDWuWHITRTkdG7J7849I2t7+YbJTR3PLoHT63LyH1Ecdkq+aMgTXxbwP4VB/hKyeXhssnx6GFsOwZt4sFw3ic3wUS32E0ey97DKwGKkuXZhESzvt0LQNdiLSF1HE/2+8NE+SMsXJ3l3W0I/42N65XPAND8uJM8vT4IfwDlH5f01F0O5qf3B/5eCJ30CsQUucd802iFlccB0RuCn484OGC4gdYFcR+dISBL1IGL+ZnGiXOsnp9zHzuw8RbTV2yPuqXgta1RayN4KzYwOpB4XHjXLLgot3ogM/jgtcJ668vKwe3GK2mCkY0HoXv+b X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 800a45f4-6f17-4700-28f1-08db8dcec3ec X-MS-Exchange-CrossTenant-AuthSource: PS1PR0601MB3737.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 11:52:19.5042 (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: chsKmEitRqSFWTx4sAMje+989Vs1pIl7iT1s4l7YUn4V+UouER5PbgIEEM/ffKYk4FSbM+e7ZUU9x9DxTWwpsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB4984 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org It is possible that dma_request_chan will return EPROBE_DEFER, which means that dma->xdev->dev is not ready yet. In this case, dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming --- drivers/media/platform/xilinx/xilinx-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index 80d6f5b072ea..16ad39bef6c6 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, snprintf(name, sizeof(name), "port%u", port); dma->dma = dma_request_chan(dma->xdev->dev, name); if (IS_ERR(dma->dma)) { - ret = PTR_ERR(dma->dma); - if (ret != -EPROBE_DEFER) - dev_err(dma->xdev->dev, "no VDMA channel found\n"); + ret = dev_err_probe(dma->xdev->dev, PTR_ERR(dma->dma), + "no VDMA channel found\n"); goto error; }