Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090305rwb; Mon, 15 Aug 2022 17:53:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR6YrElCMGjeITc0GxtVj3BZ1zu/NCg07p7WLelJZpAcZ7kn5qz+XGHDMxD3wOgk0BrtihVO X-Received: by 2002:aa7:dc13:0:b0:443:3f15:8440 with SMTP id b19-20020aa7dc13000000b004433f158440mr14938831edu.274.1660611203183; Mon, 15 Aug 2022 17:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611203; cv=none; d=google.com; s=arc-20160816; b=C/Y5m0OtIJqmpAC+bidu26pvn0mywbw63rFpfcfv8tB96xJPaGK4LaNwfZzXPCq559 Z0LNm3mj0qu4DIZhkDS2sJe0vNZOmr6SiYB1Oi1FRqg+tVB0us9VnUcECwdn2dgXI+Er aktm3w1d6Ju7V9EEuZT5gRcQ7qI0dju0yVFsZf0Opf26eussJKzsZvYn+afzhgeUiUcZ xWc+eT+AMq7PvZSOTcgYtxgebP5tzE4fx0J5DXBicnWDJvSWQUfJ693CmMwdgDyontdL BuD9T3r1F6fawuhG6OwiXhAj6VDGgT6WtZeCgS1mrisj6f0Foz3TIChm0pZRKgm0lIek cA7Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MZR8xWj7fnFwKt0CqUiPdE5RrG41yE/sc44qZR/78nk=; b=gi42qAuXi+LHRyC4gTtr9MdbIYVB14rE67GyupspCnXvSxq/1vnER1v4xsnaHwV6mY I6CxwtgHeFr6ZNk8Syq38LW0jiqkbjcVfsnyvw1XEZElNaRw15TMpstzUiQRyiCR8ahG no9jlagWOD1HwE44Pu4qc/D/Dt0vU/z6MyE7DoU5mduwtEh3DN3FiUNqGGNXoNZBMSmM mjWemXzySbceYU6hNpgj8+ofucw4QHPYJhlV3PJ93qC4om862eJXwHKd2ZC85VLgmvn+ BQEIQrJA3RiEx74+9AiDtGAFGemx47yebPe4q9VSwPNrk6AXfN+2BMN4P8s6y+7FEZry ji8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oTP846Yy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a1709063a0f00b007316e39ba62si8285634eje.235.2022.08.15.17.52.58; Mon, 15 Aug 2022 17:53:23 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oTP846Yy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345727AbiHPAOO (ORCPT + 99 others); Mon, 15 Aug 2022 20:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354935AbiHPAAk (ORCPT ); Mon, 15 Aug 2022 20:00:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6F434A83E; Mon, 15 Aug 2022 13:22:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6126160F71; Mon, 15 Aug 2022 20:22:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48A77C433D7; Mon, 15 Aug 2022 20:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594930; bh=Uwyp5EW6TYI61pBEDHY7/etR6TOT11hZlllBdjAsKrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTP846YyrBLJaRAgPjT3LgSHOLvaDJKbl3sTEbowTttIupkM5qsLjik5GZqdhamlz NCB7cesEF4z3RWmM/kWVEtvzOB/J0kU+73orbFNACNxidVS96hbmOfPKWjgM8rISxh n2VWJLqhr52ICGqehCf/9j+Px6uo14OG99ZULa9w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Miquel Raynal , Sasha Levin Subject: [PATCH 5.19 0603/1157] mtd: st_spi_fsm: Warn about failure to unregister mtd device Date: Mon, 15 Aug 2022 19:59:19 +0200 Message-Id: <20220815180503.791225435@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Uwe Kleine-König [ Upstream commit cfa7847f150c4343903d8ff2cd219418c1768205 ] 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 Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220607152458.232847-3-u.kleine-koenig@pengutronix.de Signed-off-by: Sasha Levin --- 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 52a799cae402..a5a4b612480c 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2130,7 +2130,9 @@ static int stfsm_remove(struct platform_device *pdev) clk_disable_unprepare(fsm->clk); - return mtd_device_unregister(&fsm->mtd); + WARN_ON(mtd_device_unregister(&fsm->mtd)); + + return 0; } #ifdef CONFIG_PM_SLEEP -- 2.35.1