From patchwork Thu Oct 27 13:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp227966wru; Thu, 27 Oct 2022 06:22:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6zBc+UYZOlFX1SFVBcU+HNs8Ju8RBDsqoQYppEs++MBsZDSW5khTHjUE5q847Ilky8PJwq X-Received: by 2002:a17:907:a40f:b0:790:540c:b6e3 with SMTP id sg15-20020a170907a40f00b00790540cb6e3mr42204082ejc.41.1666876942936; Thu, 27 Oct 2022 06:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666876942; cv=none; d=google.com; s=arc-20160816; b=ezjK3DDB9K2A3f37L1+iH4rYvN0StLMCkbT1RpLUSfEIZMaaOsf1n1dAfBIJFgXN/O dGFMnDZcbiPRLZUK9GrPiT5nlj+rGdLntRb3UNmuFMYfevKRgs0z0SoygFZlEehKiK1z 560fuRyV9PmD+3jJUmbE+whmFkCYE/Rb+QHKNebfHrN0ipJrLYuhFK5+S9RJ+co7oaef yKPSYZpCRCRhXSfqEVldPpWjiAzGnUhp3qa4pYl6hvnlc+HkwOrLy61Q7qOr32G2or+0 sH3YLLIyx4DGQnIr9ihE9mx3Qlc8AT4QB/B/49OzqcLmPm7tFVk0twfEboUGqg/wMOoQ Y2mA== 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 :message-id:date:subject:cc:to:from; bh=zckRJ3UyIQ1fx2dOnYtYPftd2bjLnyeuVacP4De+hRg=; b=DDHiFPBp5jCSD8zMv6rhQc3AXjKo9I65dg8GMA0uTMi1cTPztBjCaJ5bKzt5wuDJdq K+n78h4VXdg2wtSRvDzP0VS1TivWigo03KV+aheQjDCy2b/f1l/3HFzpgrVaEjbJZAXz JE17c16Q+11634VtPToOg3J3WwGT9LxfpvS+tmWRW9vsm4mofv92tda1MnN7b8ZoKbZ8 B5+uW+9yaXEAajh2GW5oeCKQb9Iajir2kuVvJdS2hBFfnldr5LvlZh/LSkb5ouqLgat5 NQAOZC48hT33R3jGKvX7a1OEBl1XRMU+3xEisohPh0DAIwU8RzsmN3ddRl39yM4RO3iE hk6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm8-20020a170907948800b0078ddffd9106si1583558ejc.932.2022.10.27.06.21.57; Thu, 27 Oct 2022 06:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235681AbiJ0NL3 (ORCPT + 99 others); Thu, 27 Oct 2022 09:11:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236101AbiJ0NKy (ORCPT ); Thu, 27 Oct 2022 09:10:54 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6245848CBB for ; Thu, 27 Oct 2022 06:10:35 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:53a:31ee:412:433f]) by laurent.telenet-ops.be with bizsmtp id d1AW2800a5LQXpN011AW98; Thu, 27 Oct 2022 15:10:32 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oo2eU-001pe7-6r; Thu, 27 Oct 2022 15:10:30 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oo2eT-00G6Wv-EE; Thu, 27 Oct 2022 15:10:29 +0200 From: Geert Uytterhoeven To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Vladimir Zapolskiy , Dmitry Torokhov Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , noreply@ellerman.id.au Subject: [PATCH 1/2] mtd: rawnand: lpc32xx_mlc: Switch to using pm_ptr() Date: Thu, 27 Oct 2022 15:10:27 +0200 Message-Id: <20221027131028.3838303-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747847157467874652?= X-GMAIL-MSGID: =?utf-8?q?1747847157467874652?= The switch to using the gpiod API removed the last user of lpc32xx_wp_disable() outside #ifdef CONFIG_PM, causing build failures if CONFIG_PM=n: drivers/mtd/nand/raw/lpc32xx_mlc.c:380:13: error: ‘lpc32xx_wp_disable’ defined but not used [-Werror=unused-function] 380 | static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host) | ^~~~~~~~~~~~~~~~~~ Fix this by switching from #ifdef CONFIG_PM to pm_ptr(), increasing compile-coverage as a side-effect. Reported-by: noreply@ellerman.id.au Fixes: 782e32a990d9d702 ("mtd: rawnand: lpc32xx_mlc: switch to using gpiod API") Signed-off-by: Geert Uytterhoeven --- drivers/mtd/nand/raw/lpc32xx_mlc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/raw/lpc32xx_mlc.c b/drivers/mtd/nand/raw/lpc32xx_mlc.c index 306e2c2165011769..ae7f6429a5f64254 100644 --- a/drivers/mtd/nand/raw/lpc32xx_mlc.c +++ b/drivers/mtd/nand/raw/lpc32xx_mlc.c @@ -850,7 +850,6 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM static int lpc32xx_nand_resume(struct platform_device *pdev) { struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); @@ -882,11 +881,6 @@ static int lpc32xx_nand_suspend(struct platform_device *pdev, pm_message_t pm) return 0; } -#else -#define lpc32xx_nand_resume NULL -#define lpc32xx_nand_suspend NULL -#endif - static const struct of_device_id lpc32xx_nand_match[] = { { .compatible = "nxp,lpc3220-mlc" }, { /* sentinel */ }, @@ -896,8 +890,8 @@ MODULE_DEVICE_TABLE(of, lpc32xx_nand_match); static struct platform_driver lpc32xx_nand_driver = { .probe = lpc32xx_nand_probe, .remove = lpc32xx_nand_remove, - .resume = lpc32xx_nand_resume, - .suspend = lpc32xx_nand_suspend, + .resume = pm_ptr(lpc32xx_nand_resume), + .suspend = pm_ptr(lpc32xx_nand_suspend), .driver = { .name = DRV_NAME, .of_match_table = lpc32xx_nand_match, From patchwork Thu Oct 27 13:10:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp227852wru; Thu, 27 Oct 2022 06:22:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pxgYokRyVnLMGo8LGKX9qJMqYkcdXPZGC0Wzulq2Htmbbc03uf2aZqm+uUs/xdFFPlqlj X-Received: by 2002:a05:6402:406:b0:458:a47:d14c with SMTP id q6-20020a056402040600b004580a47d14cmr45374137edv.41.1666876929293; Thu, 27 Oct 2022 06:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666876929; cv=none; d=google.com; s=arc-20160816; b=lOwuPAiViFv1AZTWMAJnKkkX5UX6RR2CEqZRsDkEZHUNkyOzc6KrrESW0/NCnr+wbe LcO0DybiyrzKa4m8jIGtQdAIGXI1Ir12abz4dlF8JTkuerDvdkUw8/A91k+tcvyYH/Q0 493ZQb4carpG39LYuE4TV5z8eXoVNvoq4J59S19IP06tv5IHdIjiMJ6J/G2J2cscdLaD zmZkHzFcadjwKbB0Ie6LLAWr4g/1fchJPYTMVv5aQAGmnQQKzhqMRrWktZhJA+FxiXLf f7ctqNmphiUVxjD9xKPgSab/doWqkbbCspR1L/bJcz8xrBxZc3xj5sFt4Ev0P00PJvs0 h9eQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2oSQwxOwNLm7h90Ja/N1wppRGKMz5jIVf6n4MxdzIKw=; b=I77nEBSn5sgoJDxTyVxFQ7oYHEcLkmdAR7HCxHAJjxkRQbm1I2F6rV+7IBDI79jEyo vPQGzwB8BBxo5YdjwwyfGe5lb0emdk1Ond6E8b1Eo5Y/SQlkLNBLimv5T7gHawqu1Y60 PcqFHp122h9u1t2ZzRaHrKa4F4QbfyCOXuBk2o87e79IpZmhkzwf5gVriEH8SssTg/0J unCz52hmknVEeXXVEqmTOJmY+LU9GekIDib+AU+wyhf03Bs55gYM01qNB4dPW5D6zr6I kXCEZvLfm7zS+nLmJ9zoyL8hV9xU6n86dV4v+IafV1gCac4m+ocD74Ze0MHIwt1m4fHK Uszg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a1709063b4500b00783afc3fa55si1277996ejf.283.2022.10.27.06.21.44; Thu, 27 Oct 2022 06:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236075AbiJ0NLY (ORCPT + 99 others); Thu, 27 Oct 2022 09:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236070AbiJ0NKw (ORCPT ); Thu, 27 Oct 2022 09:10:52 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BF9696FD for ; Thu, 27 Oct 2022 06:10:35 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:53a:31ee:412:433f]) by michel.telenet-ops.be with bizsmtp id d1AW2800P5LQXpN061AWZg; Thu, 27 Oct 2022 15:10:32 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oo2eT-001pe8-V4; Thu, 27 Oct 2022 15:10:29 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oo2eT-00G6Wz-FL; Thu, 27 Oct 2022 15:10:29 +0200 From: Geert Uytterhoeven To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Vladimir Zapolskiy , Dmitry Torokhov Cc: linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , noreply@ellerman.id.au Subject: [PATCH 2/2] mtd: rawnand: lpc32xx_slc: Switch to using pm_ptr() Date: Thu, 27 Oct 2022 15:10:28 +0200 Message-Id: <20221027131028.3838303-2-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221027131028.3838303-1-geert@linux-m68k.org> References: <20221027131028.3838303-1-geert@linux-m68k.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747847142963789633?= X-GMAIL-MSGID: =?utf-8?q?1747847142963789633?= The switch to using the gpiod API removed the last user of lpc32xx_wp_disable() outside #ifdef CONFIG_PM, causing build failures if CONFIG_PM=n: drivers/mtd/nand/raw/lpc32xx_slc.c:318:13: error: ‘lpc32xx_wp_disable’ defined but not used [-Werror=unused-function] 318 | static void lpc32xx_wp_disable(struct lpc32xx_nand_host *host) | ^~~~~~~~~~~~~~~~~~ Fix this by switching from #ifdef CONFIG_PM to pm_ptr(), increasing compile-coverage as a side-effect. Reported-by: noreply@ellerman.id.au Fixes: 6b923db2867cb5e1 ("mtd: rawnand: lpc32xx_slc: switch to using gpiod API") Signed-off-by: Geert Uytterhoeven --- drivers/mtd/nand/raw/lpc32xx_slc.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/mtd/nand/raw/lpc32xx_slc.c b/drivers/mtd/nand/raw/lpc32xx_slc.c index 4702577f74e5dae4..6918737346c95c8a 100644 --- a/drivers/mtd/nand/raw/lpc32xx_slc.c +++ b/drivers/mtd/nand/raw/lpc32xx_slc.c @@ -969,7 +969,6 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM static int lpc32xx_nand_resume(struct platform_device *pdev) { struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); @@ -1008,11 +1007,6 @@ static int lpc32xx_nand_suspend(struct platform_device *pdev, pm_message_t pm) return 0; } -#else -#define lpc32xx_nand_resume NULL -#define lpc32xx_nand_suspend NULL -#endif - static const struct of_device_id lpc32xx_nand_match[] = { { .compatible = "nxp,lpc3220-slc" }, { /* sentinel */ }, @@ -1022,8 +1016,8 @@ MODULE_DEVICE_TABLE(of, lpc32xx_nand_match); static struct platform_driver lpc32xx_nand_driver = { .probe = lpc32xx_nand_probe, .remove = lpc32xx_nand_remove, - .resume = lpc32xx_nand_resume, - .suspend = lpc32xx_nand_suspend, + .resume = pm_ptr(lpc32xx_nand_resume), + .suspend = pm_ptr(lpc32xx_nand_suspend), .driver = { .name = LPC32XX_MODNAME, .of_match_table = lpc32xx_nand_match,