From patchwork Mon Nov 8 09:31:52 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: 1552266 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=oefdLf9/; 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 4HnmBk6x8Hz9s5P for ; Mon, 8 Nov 2021 20:33:34 +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=FVh7XzgwESzrLeGWBH3fyx2uuUOJRzSwcNcncsUqA68=; b=oefdLf9/R2AJRn IviHCOduunyIjF61L7LvDK2aEwRhBZanvRzCttI/LNnIIyio/4+y9kCM/fWIjFZf/DG4iOOtXof5L 0KKneKejJ3wxZGUBekBHudZsDt2pJTITieJ6hPscLLUj0ElVQOUzqOygiO4wOQpLEoYkwJu2dWgiy kpF+Ilt8voA8mX61T9iA055AwlmgdxZ2V9AOC3ObfM54zdnyPTjCbzTHc4KeiQLTMhcDmVh6qZU8f 3VUIYi23axmrkxXRqji6teRtJHPuasQO/YFHN7hDH77CTFGxMWix/P0q4FUGQhJwQaJVBS3rvrpHB mJqO30k2g+V7ewrzqr+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mk11T-00FskZ-9W; Mon, 08 Nov 2021 09:33:03 +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-00FsUi-Ty for linux-mtd@lists.infradead.org; Mon, 08 Nov 2021 09:32:12 +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-0007gP-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 1mk10R-0005Zh-0a; Mon, 08 Nov 2021 10:31:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mk10Q-0001EZ-Vh; 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 4/4] mtd: sst25l: Warn about failure to unregister mtd device Date: Mon, 8 Nov 2021 10:31:52 +0100 Message-Id: <20211108093153.63792-4-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=chTrsNwtyvGFDidu8JfqkR8D1NeBCtiv8G0Xdn/Msdg=; m=7KSLr5cayipWkedCHz7+d6af4pRbjwTwvLxY0jhuRso=; p=GyFyjTLYPEwkTCbq/a6e00IrkhK4nCV0ABnVgGp+m+w=; g=6b042ce343cc284fe221ab7a9db5771a78afa793 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmGI7oUACgkQwfwUeK3K7AlbVAf+JKt +Jh1O3wHjvHkmmzbNPD9RLyL8VD2Uw0RBt7eWa80liNL4AYJP8MxcmZ7GmECL0UGgDKh/1aEOKvhj ywLbU0w6kaploF2/XU4WuYQUqWjRfm0cnihU6+dNz5x8zTbj18/YVwjOSb92eutPYg3SbgjlSdeqt qbf8XN6vitfl2utFti32McIfA4bRwZkGu2tzbVeF2ZJ5iz5cednguwT0O2MHBn4e1H2rhWJ2QfCno DcCffcYS2f6M2o+rVoLHcpxiMYw/eLTuprG9JFIP1oLEg+GaPoy7lUaSFPlnKLDaXK12JGkGXyHwd HzV6nXRbijB639b4mLtWy0/pR2Nl37Q== 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_013210_014011_2E13BBE6 X-CRM114-Status: GOOD ( 14.15 ) 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/sst25l.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c index b81c3f0b85f9..7f124c1bfa40 100644 --- a/drivers/mtd/devices/sst25l.c +++ b/drivers/mtd/devices/sst25l.c @@ -402,7 +402,9 @@ static int sst25l_remove(struct spi_device *spi) { struct sst25l_flash *flash = spi_get_drvdata(spi); - return mtd_device_unregister(&flash->mtd); + WARN_ON(mtd_device_unregister(&flash->mtd)); + + return 0; } static struct spi_driver sst25l_driver = {