From patchwork Fri Jun 3 21:07:48 2022 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: 1638865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HgmQwJSs; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LFFqm2p5Tz9sGf for ; Sat, 4 Jun 2022 07:09:08 +1000 (AEST) 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:References:In-Reply-To: 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: List-Owner; bh=dTJmMGfgH6UOlOeyv9xiXTPnkIJK1svdET4Cew0iPS4=; b=HgmQwJSsZLaPcv kHQ8cQ8+GzeVG3PgPWm3v7rcOBlyYwlyYYl/xih9wuZOCEW/+G5L/ZJKd0lKTOuWZdZpdO03nBsi4 nwK/XeoOFOT+jZ3vGF6iHllbmIqW/lFUt2d56783OUTzrus8woSb3Ubr4OXQCMpP0IkM12hHHCIHm ozDLjZJ4otSutgHWrrioYO6uY6TALFwENvoYdumUKyLBQoZXSLs35rNb8EbRXkv7eUTdtYd1hbsdc H1xh/YADMKkBJm55cWcDol3B627t3tV93nur1KHXMmsoKMGydHJY5+w6Re6WkX3RHWP8A18PK7nvY uBkF1byahKgPQo3HEkWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxEX0-008h6R-Oi; Fri, 03 Jun 2022 21:08:30 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxEWl-008gvk-GF for linux-mtd@lists.infradead.org; Fri, 03 Jun 2022 21:08:18 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxEWb-0003qo-OM; Fri, 03 Jun 2022 23:08:05 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nxEWc-006Hpx-4w; Fri, 03 Jun 2022 23:08:04 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nxEWZ-00E1HH-V0; Fri, 03 Jun 2022 23:08:03 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: kernel@pengutronix.de, linux-mtd@lists.infradead.org Subject: [PATCH 04/14] mtd: st-spi_fsm: Warn about failure to unregister mtd device Date: Fri, 3 Jun 2022 23:07:48 +0200 Message-Id: <20220603210758.148493-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603210758.148493-1-u.kleine-koenig@pengutronix.de> References: <20220603210758.148493-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1026; i=uwe@kleine-koenig.org; h=from:subject; bh=Ey4JE0XoLndZ5ZKiVN7rixjJkYfQXfGzGCyFgT+Sc2s=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBimnfR/3TQQcJHLbesqcjY7sWAMAsvppGmYvgraYS4 Sh6tABCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYpp30QAKCRDB/BR4rcrsCdzyCA CJ11QYJFve04cq4JB/NXNqh718GzpTGlPnP2JPCnlaNNUytKCx6g+p8k3uhl7aljnkDhCNv/xITtPM 031kYPMIxMf52AE3vKpTdIiUbh3L3NbFdxfhdIKXwOtAtPpi8tuBgYvpZtUe4UGiZxXwW6flE0nLxw +27AkulPkS6l3pz2BOe1bkpEHcgdxPwyMiRf/wRiT8wqpVpsePvlbSlwdcKW9AO4G3+/vl8Um0LLba n8kXfWzC8Q9hY6MqxD9k8vJp3dpCJmuNtU1Tw00qmVIRehbVNps46A0O0++JUkD8FSz/8/AAhgYJsM tQCKaTHqcMB8QZe2Y0dRKK6H3koqdD X-Developer-Key: i=uwe@kleine-koenig.org; 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_140815_670673_055035AA X-CRM114-Status: GOOD ( 14.38 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the platform remove callback a generic error message by the device core is suppressed, nothing else changes. Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [2001:67c:670:201:290:27ff:fe1d:cc33 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the platform remove callback a generic error message by the device core is suppressed, nothing else changes. This is a preparation for making platform remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/st_spi_fsm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 983999c020d6..f1d3266dda06 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2126,7 +2126,9 @@ static int stfsm_remove(struct platform_device *pdev) { struct stfsm *fsm = platform_get_drvdata(pdev); - return mtd_device_unregister(&fsm->mtd); + WARN_ON(mtd_device_unregister(&fsm->mtd)); + + return 0; } #ifdef CONFIG_PM_SLEEP