From patchwork Thu Nov 7 08:52:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 11232317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 248561575 for ; Thu, 7 Nov 2019 08:52:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC0B62187F for ; Thu, 7 Nov 2019 08:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573116767; bh=43ByQ6gvlhf2y6ofhwaPxlvBGJvkeMGzp+inDYYgrfI=; h=Date:From:To:Cc:Subject:List-ID:From; b=Z4/jF10BXqapro/3HCUaKcIV6G2KmoJ0Ws34aFb2uVIEiJOmISGLrG7pkMzpuP3jN a3S1sY1OMlSD0FQ5pSwTJJvMsnyi4+O6N6vTjRuabO8gqBXRg/xhxg9/ApvjKiMeLF bICuzC4qgfew+awbOGdeGvVyGV8tehkW3VfsPKDg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733299AbfKGIwn (ORCPT ); Thu, 7 Nov 2019 03:52:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:49748 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733257AbfKGIwn (ORCPT ); Thu, 7 Nov 2019 03:52:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E8AB2077C; Thu, 7 Nov 2019 08:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573116760; bh=43ByQ6gvlhf2y6ofhwaPxlvBGJvkeMGzp+inDYYgrfI=; h=Date:From:To:Cc:Subject:From; b=z8uYIU8wqrkyNcEFvQuzRuOr9tiCMMrrdqxbNb/qMMylJ26mbGKzc/LLTm/ROUeef vKuMNa+1Z5qtDIxhdz8aAmOpPCdOV65i2iW2jgrkVK9SIrqsdYs1R02wHHk3Tgyx7r IbOYhgAaBQzByOc+kJgwCVhU+P0cyExytWeGLYMk= Date: Thu, 7 Nov 2019 09:52:38 +0100 From: Greg Kroah-Hartman To: Patrice Chotard , Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: c8sectpfe: no need to check return value of debugfs_create functions Message-ID: <20191107085238.GA1285658@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Patrice Chotard Cc: Mauro Carvalho Chehab Cc: linux-arm-kernel@lists.infradead.org Cc: linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Patrice Chotard --- .../sti/c8sectpfe/c8sectpfe-debugfs.c | 26 +++---------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c index 8f0ddcbeed9d..301fa10f419b 100644 --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c @@ -225,36 +225,16 @@ static const struct debugfs_reg32 fei_sys_regs[] = { void c8sectpfe_debugfs_init(struct c8sectpfei *fei) { - struct dentry *root; - struct dentry *file; - - root = debugfs_create_dir("c8sectpfe", NULL); - if (!root) - goto err; - - fei->root = root; - fei->regset = devm_kzalloc(fei->dev, sizeof(*fei->regset), GFP_KERNEL); if (!fei->regset) - goto err; + return; fei->regset->regs = fei_sys_regs; fei->regset->nregs = ARRAY_SIZE(fei_sys_regs); fei->regset->base = fei->io; - file = debugfs_create_regset32("registers", S_IRUGO, root, - fei->regset); - if (!file) { - dev_err(fei->dev, - "%s not able to create 'registers' debugfs\n" - , __func__); - goto err; - } - - return; - -err: - debugfs_remove_recursive(root); + fei->root = debugfs_create_dir("c8sectpfe", NULL); + debugfs_create_regset32("registers", S_IRUGO, fei->root, fei->regset); } void c8sectpfe_debugfs_exit(struct c8sectpfei *fei)