From patchwork Wed May 24 23:49:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 766727 X-Patchwork-Delegate: computersforpeace@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wY8Jp2ptSz9s8D for ; Thu, 25 May 2017 09:50:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I1xb4QQo"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="tw5c6vJU"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=iWlrKHpzz5RNp6gt7lncbU5rOsJ3zf1vT7W4vpHctX4=; b=I1xb4QQoucOsTbaQEJZ0EW1mgF un0fqdm2QvHte+an7sCFqalhtwVrllLgeyPUXv8EHiSXVbHahfNRo7Jcx0dZcrT7usfNnC/ZDVo/k OYx+bKr5E/fWWXDolA3+Uj6SXQ9n+3wZRibFbDRLZ1WZ5oChMTaxlPq+Xu/WreXzh1OHxmzOVeEqa pKtap1t0S5Njaj++O3yDBgf/JJTPdEAa/F8doJYkP9lh/4qdBjkR6rSvn7fcwULaMehu3ZjGxgiPS ZpJta9NEhoWlmSPyQTvut1a/trZMYg3xmXSA0gtcKaNfD5EMwyLLK1pa9eXY6av+A68LyBnWhzreG WuZDismg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDg2S-0000St-9l; Wed, 24 May 2017 23:50:00 +0000 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dDg2E-0000H9-WD for linux-mtd@lists.infradead.org; Wed, 24 May 2017 23:49:49 +0000 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 42BAA8448D; Thu, 25 May 2017 11:49:20 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail; t=1495669760; bh=AKN9BXDtBcDYmjrTyna1JAiKQmbvoyns0gP3MIqjUZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tw5c6vJUnEEGHP848f6X8fab/kyJ+AYQ/oAa/Tcgc1eds9cbhdi0Q7zLVFZL+2ajy dG5ciet84gSRVKZeMd0iDXj9JZlnu43iHJLpat0jJZeizyR4YdBAvGNW61B+LuENoL 89rkFUMzixRS4wR9U4Wbayyd8Edw0QoKqUkQ+hU4= Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7, 5, 7, 9061) id ; Thu, 25 May 2017 11:49:20 +1200 Received: from chrisp-dl.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by smtp (Postfix) with ESMTP id 164FD13EECA; Thu, 25 May 2017 11:49:22 +1200 (NZST) Received: by chrisp-dl.atlnz.lc (Postfix, from userid 1030) id D19841E1DA3; Thu, 25 May 2017 11:49:19 +1200 (NZST) From: Chris Packham To: linux-mtd@lists.infradead.org, andrew@lunn.ch, computersforpeace@gmail.com, dwmw2@infradead.org, boris.brezillon@free-electrons.com, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/5] mtd: mchp23k256: add partitioning support Date: Thu, 25 May 2017 11:49:15 +1200 Message-Id: <20170524234916.16181-5-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170524234916.16181-1-chris.packham@alliedtelesis.co.nz> References: <20170524234916.16181-1-chris.packham@alliedtelesis.co.nz> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170524_164947_406397_AB24FAAA X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cyrille Pitchen , Marek Vasut , Chris Packham , Richard Weinberger MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Setting the of_node for the mtd device allows the generic mtd code to setup the partitions. Additionally we must specify a non-zero erasesize for the partitions to be writeable. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Tested-by: Andrew Lunn Acked-by: Boris Brezillon --- Changes in v2 - collect revew/test from Andrew Changes in v3: - remove setting of erasesize Changes in v4: - none drivers/mtd/devices/mchp23k256.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c index 2542f5b8b63f..3e5feb454644 100644 --- a/drivers/mtd/devices/mchp23k256.c +++ b/drivers/mtd/devices/mchp23k256.c @@ -143,6 +143,7 @@ static int mchp23k256_probe(struct spi_device *spi) data = dev_get_platdata(&spi->dev); + mtd_set_of_node(&flash->mtd, spi->dev.of_node); flash->mtd.dev.parent = &spi->dev; flash->mtd.type = MTD_RAM; flash->mtd.flags = MTD_CAP_RAM;