From patchwork Mon Nov 12 21:07:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 150878 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3612417ljp; Mon, 12 Nov 2018 13:08:20 -0800 (PST) X-Google-Smtp-Source: AJdET5fd0X9O1cwhGljyve4b2zOL62kGxM0kiX1Wpo7xvaH2+DjllkpkPjNXlljTg4/XKXW3/8HQ X-Received: by 2002:a62:32c4:: with SMTP id y187-v6mr2427667pfy.4.1542056900347; Mon, 12 Nov 2018 13:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542056900; cv=none; d=google.com; s=arc-20160816; b=HmBkY9gLqBswf7QhBFVl8QQGczHb2Rtsp9Vuq3izJjdcSW6VNy4emtSJvH/JU2QHYr 9pXeEBvjYoXaWlHbUpgmlS/PM75yr5pyyM0O4EJNrjUj7Dq6210WbOKWAVzzL3x9gUkQ w2XCByiD8TohmmgMORLDA6okRWkE7fsAQr+eSxGVPdWykwS1DPALjoijcRh/xfHJ0Br5 iu0/c+ijnxGFyLlu+x07i3eJFE2bKwM2nym5knBTulGgv/q0eYku/k3QSXLu7R9osPvs s526zEwXEXpiz7qYrhXcYBV/WnQXvZ2sqT2wsmYR0KoxwcJVEtDwDcAhGuLB3ehDgJ1U Gxwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:dkim-signature; bh=2Y18NbfOitvtAkcW4uY5FsoJ4OYvynSnh15bKWX0e2E=; b=BbmTCP+vekXyyhrgFQnCVFGV/dZkjxA/R7ipx1r4wLBNaRoKYB3IUDPVCXydq0LxP0 U0P7374x3vumczoMLQ2P4t28YM6aGovJBSlfmaGMfGNVMkJ3gaqnSkGvGBIjXyOGwi74 5fVwud67FQgK35kiPBl9CPHjFUbzlh+g5OL6Owb8ajAFTY4GBTUdqNtd+atCylBOhF5R 5zWVYPjTNvXmm8XXlBl17kO8rjUqrPLFiNl1zyl3eYVspkv4fd+k3mTDOUMpTYMbfRwt 5Do0FoUWuutsYoQMQmX9qj3xlKb0KDHO83FmpaV5Q3TpYXJMVMrPjLDyGin3sBOvdFr3 fIww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=MIRbECBt; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=g251d1Xq; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id c7si4408832plz.118.2018.11.12.13.08.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 13:08:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=MIRbECBt; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=g251d1Xq; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=2Y18NbfOitvtAkcW4uY5FsoJ4OYvynSnh15bKWX0e2E=; b=MIRbECBtsBznS0 oq/blgfCKFktSAcc1bZYf+9QjU9JDvfJzYbzOLwFaY1UUIJI4yy/g5xmrCPpt2VqrTDyMUkqF90l1 mNrn61rQTY+rUEl1g4wP+wwC44/NhwXNtRfgwbO40iMAdjb7bk3utGxHMYM1FMTrauVozhtDauJLi Z1e8Pt4MM9aL6n3Ef0KMy4jgtfv96rUaWYhJ2Sthpdr2LO3UYrAJLOXUv5L5q07gfTYM8iWXJYvyu 2s15xZeqaHvC36OTdM9BXlqqkjSLAWmHczBsaYjX2GumhKge6aPvRjYSvKHRVJ+JNeWoAsraSLOlu 2IBvDyev2DdbtqQgh9Rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMJRF-00054U-K4; Mon, 12 Nov 2018 21:08:05 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMJQx-00053s-CR for linux-mtd@lists.infradead.org; Mon, 12 Nov 2018 21:07:48 +0000 Received: by mail-lf1-x142.google.com with SMTP id p86so7223954lfg.5 for ; Mon, 12 Nov 2018 13:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=koiI/1PHULaymWnfoLRpn9RaWBQbhzFzLBZrC2fVCK0=; b=g251d1XqUOdzx1CNyn+UAIaOQX4Hd5tV3dj0h9dNDgNLe2oLgbJk1A/6fi4S4kfIhE 5M+sE+ZwGemSd8qHAxP4s2Wt513c1zl06MCWnGjy/m6w4LVsekJZI1N/a+KBvQ2sm8pz ISSPAbTIqQvGUtCqVeQL667Ct4MdI5Q4Ct3Bk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=koiI/1PHULaymWnfoLRpn9RaWBQbhzFzLBZrC2fVCK0=; b=Ztf17LU7I4Fo+lIvsGb/mXt6CZSNCw/M6Cz7PzElafy8CjbzBpg78wBtAFI8jlyVrG ToaDOm6eQ9AFTGC1bfbmdq2q3gMsKCS0BR1pdrOSdBRzbUADCzP6zjV0MhTA7yBT+fty PpRh84f8EPbjH1ASQ+DpoW1fGkmclnt4HMjbnxu76IT8TftiarWLmgYCYGFA0bNJkLHl lDmQGqqg0kp3j9BlkS/WxoxGtQExcedShG3TNbImrD+BC5vtArnYWZp6H3Lo1BxcNfLa 8lbEphBtdLuxv6+eM3VXc5V/McVdNQgkfGZCsCeSKWAPC8EZK2nU3SY2hjpIAaJfkt0U bMjg== X-Gm-Message-State: AGRZ1gL/ldDX9MO9zquOHAaWxYr8Vm864Pfu12WT5ygL7rgLy+166edH 8r43DQn/HUyseCW9g1/R21cXTg== X-Received: by 2002:a19:d5:: with SMTP id 204mr1442119lfa.116.1542056854836; Mon, 12 Nov 2018 13:07:34 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id q30sm3325736lfi.94.2018.11.12.13.07.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 13:07:33 -0800 (PST) From: Linus Walleij To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Subject: [PATCH 1/2 v2] mtd: maps: Leave assigned complex mappings Date: Mon, 12 Nov 2018 22:07:28 +0100 Message-Id: <20181112210729.23580-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181112_130747_445483_F267FBBC X-CRM114-Status: GOOD ( 13.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: Linus Walleij Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The simple_map_init() may need to be called with some function pointers already assigned for complex mappings, just bail out if complex handlers have already been assigned. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Rebase on latest MTD development branch - Use a new approach as the code changed under me --- drivers/mtd/maps/map_funcs.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.19.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/maps/map_funcs.c b/drivers/mtd/maps/map_funcs.c index 3f268370eeca..60e132293e1c 100644 --- a/drivers/mtd/maps/map_funcs.c +++ b/drivers/mtd/maps/map_funcs.c @@ -31,6 +31,10 @@ static void __xipram simple_map_copy_to(struct map_info *map, unsigned long to, void simple_map_init(struct map_info *map) { + /* Complex map functions already assigned */ + if (map->read) + return; + BUG_ON(!map_bankwidth_supported(map->bankwidth)); map->read = simple_map_read;