From patchwork Thu Jun 9 05:55:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12874842 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 6F554C433EF for ; Thu, 9 Jun 2022 05:55:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237867AbiFIFzo (ORCPT ); Thu, 9 Jun 2022 01:55:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236830AbiFIFzo (ORCPT ); Thu, 9 Jun 2022 01:55:44 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E4906141; Wed, 8 Jun 2022 22:55:41 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R911e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VFrCFzQ_1654754137; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VFrCFzQ_1654754137) by smtp.aliyun-inc.com; Thu, 09 Jun 2022 13:55:38 +0800 From: Yang Li To: broonie@kernel.org Cc: conor.dooley@microchip.com, lewis.hanly@microchip.com, linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next 1/2] spi: Remove unnecessary print function dev_err() Date: Thu, 9 Jun 2022 13:55:33 +0800 Message-Id: <20220609055533.95866-2-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c In-Reply-To: <20220609055533.95866-1-yang.lee@linux.alibaba.com> References: <20220609055533.95866-1-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org The function platform_get_irq() never returns 0, and the print function dev_err() is redundant because platform_get_irq() already prints an error. Eliminate the follow coccicheck warning: ./drivers/spi/spi-microchip-core.c:543:2-9: line 543 is redundant because platform_get_irq() already prints an error Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/spi/spi-microchip-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c index 3bd285dd4964..d8ae25ccffa8 100644 --- a/drivers/spi/spi-microchip-core.c +++ b/drivers/spi/spi-microchip-core.c @@ -539,8 +539,7 @@ static int mchp_corespi_probe(struct platform_device *pdev) } spi->irq = platform_get_irq(pdev, 0); - if (spi->irq <= 0) { - dev_err(&pdev->dev, "invalid IRQ %d for SPI controller\n", spi->irq); + if (spi->irq < 0) { ret = spi->irq; goto error_release_master; } From patchwork Thu Jun 9 05:55:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12874841 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 8ACA6C433EF for ; Thu, 9 Jun 2022 05:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230077AbiFIFzl (ORCPT ); Thu, 9 Jun 2022 01:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229904AbiFIFzk (ORCPT ); Thu, 9 Jun 2022 01:55:40 -0400 Received: from out199-2.us.a.mail.aliyun.com (out199-2.us.a.mail.aliyun.com [47.90.199.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D00C56141; Wed, 8 Jun 2022 22:55:38 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R781e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VFrDhR7_1654754134; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VFrDhR7_1654754134) by smtp.aliyun-inc.com; Thu, 09 Jun 2022 13:55:35 +0800 From: Yang Li To: broonie@kernel.org Cc: conor.dooley@microchip.com, lewis.hanly@microchip.com, linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next 2/2] spi: fix platform_no_drv_owner.cocci warning Date: Thu, 9 Jun 2022 13:55:32 +0800 Message-Id: <20220609055533.95866-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Remove .owner field if calls are used which set it automatically. Eliminate the following coccicheck warning: ./drivers/spi/spi-microchip-core.c:624:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/spi/spi-microchip-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c index 5b2aee30fa04..3bd285dd4964 100644 --- a/drivers/spi/spi-microchip-core.c +++ b/drivers/spi/spi-microchip-core.c @@ -621,7 +621,6 @@ static struct platform_driver mchp_corespi_driver = { .name = "microchip-corespi", .pm = MICROCHIP_SPI_PM_OPS, .of_match_table = of_match_ptr(mchp_corespi_dt_ids), - .owner = THIS_MODULE, }, .remove = mchp_corespi_remove, };