From patchwork Wed Oct 11 03:26:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 115485 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp273930qgn; Tue, 10 Oct 2017 20:27:32 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBBMwLhlZtzJLXLubPyC5wYIyR0uYiT0hT5v2WENq4lQCH2lVGcxRn9YqLzh2ZS0tDb0Sf4 X-Received: by 10.98.13.8 with SMTP id v8mr15377082pfi.180.1507692451956; Tue, 10 Oct 2017 20:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507692451; cv=none; d=google.com; s=arc-20160816; b=U3slX490oIDjw2UPhcKaoQZNm9w9TNH+N7f1OD/wcgx0+/pj2aCTqtpq2biBS7Yeta 2V5PlzKR0pbIUz5Aq/bmtuDx0pt5g3NO43ouohuFz7CxvVrSmM9m5elMcgs3vAruL4na kfSFxiwVA6dt2f7hVG/aD4s20EuOzyCF+gq9i0Wef5Bh0sYd6y2w9QR1ST3Hm/agWSd1 CIGrbHDZ9/rF2r17A+Tf0f6X5CSTaC2AKAenL1PFWalC0QgXSk+yfNejHhiAMFz4hcED SH/zRHozpeRUxvTCLHsL7dsHr1qteW1/kuYkb95DQSxEmrO/lRlZ/aQeMZfy3/7rphFM KyFA== 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=kJgjE7UloDl4UbH0SHEuJW3Hhzq6nuwXDWu62PAhCKk=; b=o90iyB2PQiY765wSG08SUIta4sDzqmhoUpPGY2Ame58fccfmjNM+G5bRjjjd4SXx/K YzWyXdEQiNZMdj3jaTxA6x2v8l73ReH5usdvs5OmsgSaMB7yvwNiNsoe9GURCU4IyhFH ez3o1MJGe3shdGy7UB9BkZJ3HSUst2mYJ+XsAwAvRx4RnfvOS/Sm21lHq6Vnri3OBDB6 UE3zS8D4F1pAN+QADJ6vdbZ3h1dc2SaCuw3e2cvoqnyecFx65vuXq6F2M5Zo/rsSwJqT NXsFR5BplNLU8QLwqVTy9SlFL+dgmc3glTpF7/L73KjdwfxpB+hR4MDbs2Bk8GBnCgK5 /KAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=hXJFcYL6; dkim=neutral (body hash did not verify) header.i=@pobox.com header.s=sasl header.b=FSAWz+K2; 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 x85si10165923pfk.613.2017.10.10.20.27.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Oct 2017 20:27:31 -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=hXJFcYL6; dkim=neutral (body hash did not verify) header.i=@pobox.com header.s=sasl header.b=FSAWz+K2; 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=kJgjE7UloDl4UbH0SHEuJW3Hhzq6nuwXDWu62PAhCKk=; b=hXJFcYL6+FMDUYRmqQD/zKUCGD jW5p5eisJZ5m9Y36SK4WDi6LhE4VqQpLdHNVoSPl13Lc5LT51zpXx/Zx8TIpdulF14jcCFDgadqX9 vbMwmUu9wUpAb7Lt4p6cpEatuET+x6MnLG6RXcxYtJnrtzw5enWKaIHVeGH9QbICZ+qFjBxISjzGE 3ziaIGbV4Hb97wNg+4t8Hw6gcX7R2udn0PLpdPzuczIz4pl8+KrdPRPDYzGqd1/QMlYwJABZcLoba rJQWM7qtHkzRVIWmlt4nZ+U0gsF5e7NGzePuBc6Y1QyRTQsbz771uz7rsy7na59C2JAOebZl9Zh29 eFbm/OvA==; 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 1e27g7-0003BZ-OU; Wed, 11 Oct 2017 03:27:27 +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 1e27fZ-0002Lr-0G for linux-mtd@lists.infradead.org; Wed, 11 Oct 2017 03:26:58 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 8111DA7286; Tue, 10 Oct 2017 23:26:27 -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=wQgk 6G6KtIZtuE3WTSSqIuK0mFY=; b=FSAWz+K28+sQM3KDkpSrOrFOPiPeCvuh5/Wc stoZHVxvmXhXn6fdmYIBGEkyXKZXRwsfukUSFJ3u5qRpLxdH74HmvMEkHJvUJhuh 6m9d09VzNQ/mT1CXhl8XGLK0dIFUUNZsd975bKU2JQDycfd60BKgbGrIlvctaYg3 rCENDC8= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 77706A7285; Tue, 10 Oct 2017 23:26:27 -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 DEC3EA7282; Tue, 10 Oct 2017 23:26:26 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 7FC302DA0660; Tue, 10 Oct 2017 23:26:25 -0400 (EDT) From: Nicolas Pitre To: Boris Brezillon Subject: [PATCH 3/5] MTD: chips/map_rom.c: implement point and unpoint methods Date: Tue, 10 Oct 2017 23:26:19 -0400 Message-Id: <20171011032621.26979-4-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20171011032621.26979-1-nicolas.pitre@linaro.org> References: <20171011032621.26979-1-nicolas.pitre@linaro.org> X-Pobox-Relay-ID: F70A6618-AE33-11E7-8351-575F0C78B957-78420484!pb-smtp2.pobox.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171010_202653_263781_4ADB32E2 X-CRM114-Status: GOOD ( 11.47 ) 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: linux-mtd@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Signed-off-by: Nicolas Pitre --- drivers/mtd/chips/map_rom.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_rom.c b/drivers/mtd/chips/map_rom.c index e67f73ab44..722afb1cf4 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c @@ -22,6 +22,10 @@ static struct mtd_info *map_rom_probe(struct map_info *map); static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); static unsigned long maprom_unmapped_area(struct mtd_info *, unsigned long, unsigned long, unsigned long); +static int maprom_point (struct mtd_info *mtd, loff_t from, size_t len, + size_t *retlen, void **virt, resource_size_t *phys); +static int maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len); + static struct mtd_chip_driver maprom_chipdrv = { .probe = map_rom_probe, @@ -52,6 +56,8 @@ static struct mtd_info *map_rom_probe(struct map_info *map) mtd->type = MTD_ROM; mtd->size = map->size; mtd->_get_unmapped_area = maprom_unmapped_area; + mtd->_point = maprom_point; + mtd->_unpoint = maprom_unpoint; mtd->_read = maprom_read; mtd->_write = maprom_write; mtd->_sync = maprom_nop; @@ -78,6 +84,24 @@ static unsigned long maprom_unmapped_area(struct mtd_info *mtd, { struct map_info *map = mtd->priv; return (unsigned long) map->virt + offset; + +static int maprom_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 maprom_unpoint(struct mtd_info *mtd, loff_t from, size_t len) +{ + return 0; } static int maprom_read (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)