From patchwork Wed Oct 30 23:42:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 287365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 668A92C034E for ; Thu, 31 Oct 2013 10:43:46 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbfQF-0005e6-20; Wed, 30 Oct 2013 23:43:35 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbfQ5-0002TY-UI; Wed, 30 Oct 2013 23:43:25 +0000 Received: from mail-oa0-x235.google.com ([2607:f8b0:4003:c02::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbfQ4-0002S9-Av for linux-mtd@lists.infradead.org; Wed, 30 Oct 2013 23:43:24 +0000 Received: by mail-oa0-f53.google.com with SMTP id n12so2270972oag.40 for ; Wed, 30 Oct 2013 16:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VAH1uVHSL4lZvRCDOQ0qkU4Q08/Ai84ijRMaRfN0QYc=; b=N9D01A3OzcwrAr4CZAHA7a92WJvA0fmDEEakZQ50beOg3kE6AOCoJRkivbBYrEWhaE y/CHkKfA9OJEmQY0cUO+EvELmogFb8NIRxH0k9BYsD9+HUlAQIV17UTdhl82h+SLHE9M Wsf9PNUt20MJQVywh69dolobCGpMx51ZXNX6PmM21RCGk4PcBL3+guvOVib0GB1p3Mm7 oEPUaEpVGfXbnA+aWd6Zv+4MHcK2dyFMGENvUqJuTge2aMAg6fnIe2glClb5Zl4EyOxi XBe3auJCzAKn8cbvNL8ArKgDrWlgxsMiUGbQYOLmNI82g/aInsTeXvN7/7zJd9AICyx4 ORyQ== X-Received: by 10.60.149.169 with SMTP id ub9mr158611oeb.39.1383176582767; Wed, 30 Oct 2013 16:43:02 -0700 (PDT) Received: from localhost.localdomain ([12.222.76.199]) by mx.google.com with ESMTPSA id it7sm930240obb.11.2013.10.30.16.43.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Oct 2013 16:43:02 -0700 (PDT) From: Brian Norris To: Subject: [PATCH] mtd: m25p80: fixup device removal failure path Date: Wed, 30 Oct 2013 19:42:51 -0400 Message-Id: <1383176571-28057-1-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.8.1.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131030_194324_421966_70814C2F X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (computersforpeace[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Marek Vasut , Brian Norris X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Device removal shouls fail if MTD unregistration fails. Signed-off-by: Brian Norris Reviewed-by: Marek Vasut --- drivers/mtd/devices/m25p80.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 58978892c321..7eda71dbc183 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -1125,9 +1125,7 @@ static int m25p_remove(struct spi_device *spi) struct m25p *flash = spi_get_drvdata(spi); /* Clean up MTD stuff. */ - mtd_device_unregister(&flash->mtd); - - return 0; + return mtd_device_unregister(&flash->mtd); }