From patchwork Mon Nov 8 09:31:51 2021 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: 1552265 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=fX7cnCxR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::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:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HnmBd20N5z9s5P for ; Mon, 8 Nov 2021 20:33:29 +1100 (AEDT) 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=L5FXg+4kkT4RjzmyUG+yRDPCd+0TUgDIGA4PuvWsXvs=; b=fX7cnCxRebf5fq MdDOZ2U8o/91z9QoUOmEh8+0s4F6BLf/++Jp0Ee2nNElvp9Dg/JdBaCchgF5N9ii8EOpugKaEB7vh jMGOSjz4H93Sju2DXTf5fI3P36ZgjnOaqZIFLwGBBIHcDOSXtk0kocCTKD9JdKXsTylkgwqdWO9dc DfMfPe1GouinPIOrXqqVy05sE2wb4VLHDsbE70GvlCRXCb7XndMwokmOI4znVWmAyCazpqR8wGbHb zDqL1a/itxCSghHltPyzrr+lB78gGNHZC42Ywh0NwCwps8FIS+D7X0zvk6IP+qZUS5JDZZgPVcU7g f6WsdBDWRlmcMBCOOHqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk116-00Fsd1-TL; Mon, 08 Nov 2021 09:32:40 +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 1mk10b-00FsTy-Ib for linux-mtd@lists.infradead.org; Mon, 08 Nov 2021 09:32:11 +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 1mk10S-0007gO-Q1; Mon, 08 Nov 2021 10:32:00 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mk10Q-0005Ze-S4; Mon, 08 Nov 2021 10:31:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mk10Q-0001EO-Ql; Mon, 08 Nov 2021 10:31:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Mark Brown , linux-mtd@lists.infradead.org, kernel@pengutronix.de, linux-spi@vger.kernel.org Subject: [PATCH 3/4] mtd: mchp48l640: Warn about failure to unregister mtd device Date: Mon, 8 Nov 2021 10:31:51 +0100 Message-Id: <20211108093153.63792-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211108093153.63792-1-u.kleine-koenig@pengutronix.de> References: <20211108093153.63792-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=KPueYbzN9LsEzHTCniRvcOu6N1K1tzW4s5WqwnR8va8=; m=7KSLr5cayipWkedCHz7+d6af4pRbjwTwvLxY0jhuRso=; p=hGZdSTOrMcSxD0z98kFDa/PL7nWvDIhwAQlm55SyVEI=; g=055d2b75ea63c5577b57932fc070711b7ba69e95 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmGI7oEACgkQwfwUeK3K7AnCygf8Dvv 9ndtG9tZ7CfbWkaaldDLo9S8zeI9cjSH1ILmHhH5XoB1+01J+bSPIA2T4VVrhjTKn0ze+QygwTjxy Z/c7rsPvfJQqA7q7eBJqvcH0R5k3nK7VR42MKtLVLmE0NyyBtwfH5TawTRFEMsWULtj080rK3hZjz B+Zc2qMFm45vTEd0x+WDVru3VuPHOodiNfy7J2UGOg6J53v8Tz6wm3WjWqoeX2bmLjUR9Z4J8LQyD ACxuGKYP5vANDkeRdlZRkFJxu0X9YzCuRqwOz1AveL2jSLIvJo34PW20xiMPZqrAXiqMT9+vE4OFk 3cZaItlaSbGQ7D6cVimnFy/lvux7l7A== 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-20211108_013209_684389_44D5EECE X-CRM114-Status: GOOD ( 14.14 ) 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 spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. 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 spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/mchp48l640.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c index 99400d0fb8c1..231a10790196 100644 --- a/drivers/mtd/devices/mchp48l640.c +++ b/drivers/mtd/devices/mchp48l640.c @@ -345,7 +345,9 @@ static int mchp48l640_remove(struct spi_device *spi) { struct mchp48l640_flash *flash = spi_get_drvdata(spi); - return mtd_device_unregister(&flash->mtd); + WARN_ON(mtd_device_unregister(&flash->mtd)); + + return 0; } static const struct of_device_id mchp48l640_of_table[] = {