From patchwork Sun Oct 8 20:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13412784 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E5C2E95A67 for ; Sun, 8 Oct 2023 20:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cbwVn68Tdy5rAMmYqZmV6VL9N/n/PbFWpLKOhVK+Ils=; b=IbiQaQA4v4RUw6 2DkqH8gGAwlJ4vztMeYsq3YCxEqtBFVUJqFUTecYzu7ueCrU/8v6X8R1S5JH88Am9UUtu2XfKwmij bXvfQ/zP+uknYPgU3FacLsst4n9ZDUooIRw4rDDWv3LACwRpTwZ68eZp8i30H7roBxExCjWE3OEgI CcVCQ8kJqxy0P2vWVsQSyPONFjd5+R/8pAUr1WL2paYJiwjMsOMCIFd4TNw35AwjuKnASOVeo4JQZ xqQsEmp0Rda8cQbd7Dk7m83WNjAHp0l0/09P0hu6RN/Sn6ipDfY5H4TxpBnQwYZ4q48RtTkMtE10S CfPni+AzgYSnFF1VCHsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qpa0m-009FNm-1T; Sun, 08 Oct 2023 20:04:24 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpa0k-009FMV-2C for linux-arm-kernel@bombadil.infradead.org; Sun, 08 Oct 2023 20:04:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=3UzLw627FVkrRm5YPmsQ6qBqtgZcgxUtft/IhjYlx5g=; b=NQ0FuJaYOKIIJpHF6OBTCkfey8 yTLXHvaiH/LYBECLsgrwzxAt6Bmw5W/ZbWc7Hfe0djZVcA/6VifnS4eaXTFL9ib1THUNKYge0lhHW FxQa4RlfF2KAmi7xaM4ROhaxMifJ2nRliUEnGr1i5GYODGB0u9QvlqOlJlytb62TfEtTrtxi8q4RV 9mkENPb51FHAcf/VyiynT3l/uEyh7bhiVV+R4y3DOwG1Nkn7Z9YWpAaakcFN/9PviqiULdssiJV6h GhwTN5/iqQyu0ndy8R7GZNzvhwaZO7vraZ2kKf5BfTMyzzqjWhOwKwu7he1rfCGNagbOToNJz7r60 DMpGayhw==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpa0c-00Exaz-2s for linux-arm-kernel@lists.infradead.org; Sun, 08 Oct 2023 20:04:21 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpZyS-0001Rz-A6; Sun, 08 Oct 2023 22:02:00 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpZyL-000Ez8-3z; Sun, 08 Oct 2023 22:01:53 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpZyK-00Bezw-PY; Sun, 08 Oct 2023 22:01:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: David Woodhouse , Atsushi Nemoto , Andrew Morton , linux-mtd@lists.infradead.org, kernel@pengutronix.de, linux-kbuild@vger.kernel.org, Robert Jarzmik , Joern Engel , Michael Ellerman , Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org, Yangtao Li , Rob Herring , Li Zetao , Christophe JAILLET , Tudor Ambarus , Hui Tang , Zheng Yongjun , Heiko Stuebner , Linus Walleij , Pratyush Yadav , Michael Walle , Vladimir Zapolskiy , linux-arm-kernel@lists.infradead.org Subject: [PATCH 00/20] mtd: Convert to platform remove callback returning void Date: Sun, 8 Oct 2023 22:01:23 +0200 Message-Id: <20231008200143.196369-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4139; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=aa6SE3gWpaHTuyfq4v/sxGd7EehqufNhl2EDrrsJWOQ=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlRlrnLPoKUeQvyaTxuFWZ/OXFizKe5m/A+PtikJ0Ukdr qwXpBI6GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZiISDD7PyWTOakmExfPWSyu v9voS6C7FXdan5pmyQrjiye/v9j25eHul21Nr2RPvF76tXMKo7r99v6sA01L3h1JfFq5xXyKZmz nubtHmtecskjM6rgf+/OK9MalV7taHt85zWKwpYQ3O960UJNNvLPf4JKPp3xLzIVQ2ZltTqVbmL xX9YS5JehVlj55ynxmpmKm2jJreyNnmeueYaK7xPdoyE9a7fj14LSCk9xc86dd8zDZ8vlH9/aa9 JRi9qb7k79lncjhuLcg5IK1HNunIy3HVfa4JC4ubfZ2MmYt/LjfwOmxmAOH2Y4T1mGGdafFjjme 2fEw+XFkwDdzR96WbSda7tWGiq1heTfNPzBV0e5R8Kt5AA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231008_210419_413453_FE58C8AC X-CRM114-Status: GOOD ( 14.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, this series converts all platform drivers below drivers/mtd to use the .remove_new() callback. Compared to the traditional .remove() callback .remove_new() returns no value. This is a good thing because the driver core doesn't (and cannot) cope for errors during remove. The only effect of a non-zero return value in .remove() is that the driver core emits a warning. The device is removed anyhow and an early return from .remove() usually yields resource leaks and/or use-after-free bugs. All drivers touched here returned zero unconditionally in their remove callback, so they could all be converted trivially to .remove_new(). See commit 5c5a7680e67b ("platform: Provide a remove callback that returns no value") for an extended explanation and the eventual goal. As an added bonus the series starts with a minor fix and a simplification of the txx9ndfmc driver. The only interdependencies in this series is between the three txx9ndfmc patches. As there are still quite a few drivers to convert, I'm happy about every patch that makes it in. So even if there is a merge conflict with one patch until you apply (or a different concern that doesn't apply to all patches), please apply the remainder of this series anyhow. I'll come back to the part that you (maybe) skipped at a later point. Best regards Uwe Uwe Kleine-König (20): mtd: rawnand: txx9ndfmc: Mark driver struct with __refdata to prevent section mismatch warning mtd: rawnand: txx9ndfmc: Drop if block with always false condition mtd: bcm47xxsflash: Convert to platform remove callback returning void mtd: docg3: Convert to platform remove callback returning void mtd: phram: Convert to platform remove callback returning void mtd: powernv_flash: Convert to platform remove callback returning void mtd: spear_smi: Convert to platform remove callback returning void mtd: st_spi_fsm: Convert to platform remove callback returning void mtd: hyperbus: hbmc-am654: Convert to platform remove callback returning void mtd: hyperbus: rpc-if: Convert to platform remove callback returning void mtd: lpddr2_nvm: Convert to platform remove callback returning void mtd: maps: lantiq-flash: Convert to platform remove callback returning void mtd: maps: physmap-core: Convert to platform remove callback returning void mtd: maps: plat-ram: Convert to platform remove callback returning void mtd: maps: pxa2xx-flash: Convert to platform remove callback returning void mtd: maps: sa1100-flash: Convert to platform remove callback returning void mtd: maps: sun_uflash: Convert to platform remove callback returning void mtd: rawnand: txx9ndfmc: Convert to platform remove callback returning void mtd: spi-nor: hisi-sfc: Convert to platform remove callback returning void mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning void drivers/mtd/devices/bcm47xxsflash.c | 6 ++---- drivers/mtd/devices/docg3.c | 5 ++--- drivers/mtd/devices/phram.c | 6 ++---- drivers/mtd/devices/powernv_flash.c | 6 ++---- drivers/mtd/devices/spear_smi.c | 6 ++---- drivers/mtd/devices/st_spi_fsm.c | 6 ++---- drivers/mtd/hyperbus/hbmc-am654.c | 6 ++---- drivers/mtd/hyperbus/rpc-if.c | 6 ++---- drivers/mtd/lpddr/lpddr2_nvm.c | 6 ++---- drivers/mtd/maps/lantiq-flash.c | 6 ++---- drivers/mtd/maps/physmap-core.c | 5 ++--- drivers/mtd/maps/plat-ram.c | 8 +++----- drivers/mtd/maps/pxa2xx-flash.c | 5 ++--- drivers/mtd/maps/sa1100-flash.c | 6 ++---- drivers/mtd/maps/sun_uflash.c | 6 ++---- drivers/mtd/nand/raw/txx9ndfmc.c | 15 +++++++++------ drivers/mtd/spi-nor/controllers/hisi-sfc.c | 5 ++--- drivers/mtd/spi-nor/controllers/nxp-spifi.c | 6 ++---- 18 files changed, 44 insertions(+), 71 deletions(-) base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d Acked-by: Tudor Ambarus