From patchwork Fri Jan 15 10:34:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Izard X-Patchwork-Id: 568017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D5F92140BFD for ; Fri, 15 Jan 2016 21:37:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=QZjAN70F; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aK1jX-0004GH-BH; Fri, 15 Jan 2016 10:35:55 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aK1jQ-00049U-Ik for linux-mtd@lists.infradead.org; Fri, 15 Jan 2016 10:35:49 +0000 Received: by mail-wm0-x243.google.com with SMTP id l65so2124671wmf.3 for ; Fri, 15 Jan 2016 02:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mFRETnc4/NubpwQmSgzBeCTVLZ7ti5tfsqTssjry4xo=; b=QZjAN70FKqQYfIJcrmRPE3igTI8CoDw4QIstG3tz97ZVSjD4mAwIHAJlhskjb3VQZc ivv3az3OZ+Q543Das/KU9mdtwlMWCCEiN7JWcSXD54airTVc94qirKK6iSH7eUJmRmLM pvaf3YYWq6OwVio2cl9aid9ziJBBAMPkMBu9jx6aBZSBq547gvTGP5ZUT0iIJNnfwzyI GQQe6i6tkoZLslV6/W4YJqAiAW+XN1bbZ3ek+AwLcV8tCXbDp03m8vP4OxgK14rXf5Up IkaLhiqB55giQh/AjZBCuT1pMqfCcgxbLBlQwHa249sBcCHYfrbTjl8SxojOjSTrEdmx ZkJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mFRETnc4/NubpwQmSgzBeCTVLZ7ti5tfsqTssjry4xo=; b=ZpWOYFREBZUKz+8FgVXF3FtsQDSCrAsgQrz8vLvE5bAsyqF+/590y1eVJvU9dbqjUM SFGMv27Jwvn8u95OE/pjIW/LaVuCus3xCN7Gj7i6EF+PYWWq8PXZxDxvxL3piLDeq3jW jK7H11pzjX+8pr3Es/mFOZVyIGpH9dDmZ9Osgs7ny9UEuATmSubzRvIdNN7b3wMvRRqF 3tywpJRWXF/Iu0aGzqpX0vRU+JjDtsqx/IAwuBpKJAZpNo+pkRJMV/1QcD22RxRWFPfH tmmnkINEqO1TmtxrKz85hxbUdTl/2XFdLCJpByAqvV/EIff0jHePgM9PnAarc4aNjIFL oTIw== X-Gm-Message-State: AG10YOTiGBqnXuqz8zda3ogv/Lbgn2WI5Y4JuCK81/4qZrDvcLLDlal0p9mi3FP1TSYdpQ== X-Received: by 10.194.188.100 with SMTP id fz4mr4421219wjc.126.1452854131091; Fri, 15 Jan 2016 02:35:31 -0800 (PST) Received: from localhost.localdomain (ram94-11-88-187-113-157.fbx.proxad.net. [88.187.113.157]) by smtp.gmail.com with ESMTPSA id w1sm1945189wmd.2.2016.01.15.02.35.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jan 2016 02:35:30 -0800 (PST) From: Romain Izard To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/8] mtd: atmel_nand: Use of_device_get_match_data Date: Fri, 15 Jan 2016 11:34:57 +0100 Message-Id: <1452854102-6125-4-git-send-email-romain.izard.pro@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1452854102-6125-1-git-send-email-romain.izard.pro@gmail.com> References: <1452854102-6125-1-git-send-email-romain.izard.pro@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160115_023548_846690_40EF525D X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:243 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (romain.izard.pro[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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Josh Wu , Romain Izard , Nicolas Ferre , Yang Wenyou MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Remove the need for forward declaration and the risk for a null pointer when accessing the private part of the compatible match table, by using the newly introduced of_device_get_match_data function. Signed-off-by: Romain Izard --- v2: new patch drivers/mtd/nand/atmel_nand.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 6e548fc3ab7b..b5e2e62cd261 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -1485,8 +1485,6 @@ static void atmel_nand_hwctl(struct mtd_info *mtd, int mode) ecc_writel(host->ecc, CR, ATMEL_ECC_RST); } -static const struct of_device_id atmel_nand_dt_ids[]; - static int atmel_of_init_port(struct atmel_nand_host *host, struct device_node *np) { @@ -1497,7 +1495,7 @@ static int atmel_of_init_port(struct atmel_nand_host *host, enum of_gpio_flags flags = 0; host->caps = (struct atmel_nand_caps *) - of_match_device(atmel_nand_dt_ids, host->dev)->data; + of_device_get_match_data(host->dev); if (of_property_read_u32(np, "atmel,nand-addr-offset", &val) == 0) { if (val >= 32) {