From patchwork Mon Oct 30 18:48:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 117498 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2926675qgn; Mon, 30 Oct 2017 11:50:11 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Q97uwFQAb+pGvbov5bkkaAL3KdnQxJskTcbBTGgC9pQ1jqytaPmCiH3VJJox9bXfawYRce X-Received: by 10.101.65.198 with SMTP id b6mr8442910pgq.136.1509389411388; Mon, 30 Oct 2017 11:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509389411; cv=none; d=google.com; s=arc-20160816; b=h8lW89A++snD7AoA9SZKoPyea3QXmlhnftBxsVi+WfXBDjxfddFyejQzj9w0TbyK9p FnNJkaZOfd+QqxUkf6VQOXrHPNA1hzcZMQwsG7h3hr+ChJlItK3/v18LKTAgw/vWTLV3 2wp56GasMOM5QOHGsXt2esvzwYplgR1jjw2LdSvgIQSfBz+2b964WpnOzcQNvkSKkEA6 FdrfDQ+YM3Re8btyGoVQuU3yVl6sQ6gdR+ahRvn3dYfn8Nb1emMUKkAqTqBjwwWwRyEd viiKhPuKEPLXg9DFMbNqer2ZmEdDAAokhbzD0V6HzcTz2cxwePYR+oyDrZT0b0SWG9hQ 7MIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-signature:arc-authentication-results; bh=c/L4yoxcuKGT44Idg1WrrwrESl8yKqnS1u0GM2BeWZU=; b=dz+uwH0aJtEbWoLHjsSLBlZqut/EtJN6C3znERYCn7vT6h1nCGjZGnPUQY97dU2ymD Yn5BKxUYEzRiy8YlqJ6El6uOuuGU4f45ZRokNCoFJoTPLCCttOUYJorevZoUbcNG0oJH LP8mZTvZyHNm+WCmybrHlTaHGIBq+6k/XppkGrQczMeB4bmCe678WPZSh4MiFdiTNb+5 3n4XiQNxqDFWUR1uufkwsZU5LLYxSWSbhQquWN+evF2qPGwJzo5OagIR/+1LL6DIgoJ4 R6Q+nK3ePFYqInCWjzzBR0m0Qk2VMLtt93aQ52ecWiOe0JnR17YX5JrRURDK85SlSftg Phdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=YLCTlntu; dkim=neutral (body hash did not verify) header.i=@pobox.com header.s=sasl header.b=JZCk7ZNj; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id n8si10644841pgs.144.2017.10.30.11.50.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Oct 2017 11:50:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=YLCTlntu; dkim=neutral (body hash did not verify) header.i=@pobox.com header.s=sasl header.b=JZCk7ZNj; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=c/L4yoxcuKGT44Idg1WrrwrESl8yKqnS1u0GM2BeWZU=; b=YLCTlntu+qrOA2cgr8YeORuGFy 3UHbRGL7+nwREPXLZ5YepnAjqsFLeckXnUvOebPLeYvnztnQuNJncCurOQtstLY+p8Mue5Tz+Zyik WZbjUDpnsilyDPg/waYNX3TOH/ENQ9O+ARgHvUpV0cR9RiyjkwUohZb+5UvMkhRs66WNm7TBZpcaL rqmtQzpPG4UH9N1gvboHAmLtV7UGUR7P2uRpmU9i5m94P0m8/thmscGPReJAH4OMDc7aB36310SHt QVv1WC6hmdB7IOxurcxM2goCb2HPMkG+dUJVPpWb7/FZHc5aXIXHe+W7weLT+Ldz2f9CbMx11bIMO dXoK3mWA==; 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 1e9F8R-00017E-Ll; Mon, 30 Oct 2017 18:50:07 +0000 Received: from pb-smtp2.pobox.com ([64.147.108.71] helo=sasl.smtp.pobox.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e9F7M-0000MZ-DK for linux-mtd@lists.infradead.org; Mon, 30 Oct 2017 18:49:05 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 1B9A6A1E0B; Mon, 30 Oct 2017 14:48:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references; s=sasl; bh=VKjL lwjI731NZIA7rGd/r3q5h4g=; b=JZCk7ZNjWN9KCafDAULeHTvYZN2KQBSG3WA1 ltlGOC70MIuohvpS6qvdEURBJxwJppKEZOKmlBgwQJnpdooK7wfzhKN4kTdGKXgL MXkJZYcW77tk9cltUDs7Fjb/e3lCKCCVKRZ//7GptVDa06yGu7JUmOv3PgGGuxxz ZO4JFLc= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 12F9CA1E08; Mon, 30 Oct 2017 14:48:38 -0400 (EDT) Received: from yoda.home (unknown [137.175.234.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 9B782A1E05; Mon, 30 Oct 2017 14:48:37 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id C4C2A2DA0529; Mon, 30 Oct 2017 14:48:36 -0400 (EDT) From: Nicolas Pitre To: Boris Brezillon , Richard Weinberger Subject: [PATCH v3 2/5] MTD: chips/map_ram.c: implement point and unpoint methods Date: Mon, 30 Oct 2017 14:48:30 -0400 Message-Id: <20171030184833.20709-3-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171030184833.20709-1-nicolas.pitre@linaro.org> References: <20171030184833.20709-1-nicolas.pitre@linaro.org> X-Pobox-Relay-ID: F0920150-BDA2-11E7-AF85-575F0C78B957-78420484!pb-smtp2.pobox.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171030_114900_681516_E2D921C5 X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [64.147.108.71 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: Chris Brandt , linux-mtd@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This will allow for the removal of the get_unmapped_area method later. Signed-off-by: Nicolas Pitre Reviewed-by: Richard Weinberger Acked-by: Boris Brezillon --- drivers/mtd/chips/map_ram.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) -- 2.9.5 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c index afb43d5e17..c3939dd230 100644 --- a/drivers/mtd/chips/map_ram.c +++ b/drivers/mtd/chips/map_ram.c @@ -22,6 +22,9 @@ static void mapram_nop (struct mtd_info *); static struct mtd_info *map_ram_probe(struct map_info *map); static unsigned long mapram_unmapped_area(struct mtd_info *, unsigned long, unsigned long, unsigned long); +static int mapram_point (struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, void **virt, resource_size_t *phys); +static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len); static struct mtd_chip_driver mapram_chipdrv = { @@ -69,7 +72,9 @@ static struct mtd_info *map_ram_probe(struct map_info *map) mtd->_read = mapram_read; mtd->_write = mapram_write; mtd->_panic_write = mapram_write; + mtd->_point = mapram_point; mtd->_sync = mapram_nop; + mtd->_unpoint = mapram_unpoint; mtd->flags = MTD_CAP_RAM; mtd->writesize = 1; @@ -96,6 +101,25 @@ static unsigned long mapram_unmapped_area(struct mtd_info *mtd, return (unsigned long) map->virt + offset; } +static int mapram_point(struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, void **virt, resource_size_t *phys) +{ + struct map_info *map = mtd->priv; + + if (!map->virt) + return -EINVAL; + *virt = map->virt + from; + if (phys) + *phys = map->phys + from; + *retlen = len; + return 0; +} + +static int mapram_unpoint(struct mtd_info *mtd, loff_t from, size_t len) +{ + return 0; +} + static int mapram_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) { struct map_info *map = mtd->priv;