From patchwork Tue Dec 1 11:03:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boris Brezillon X-Patchwork-Id: 550802 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 850DD1401DE for ; Tue, 1 Dec 2015 22:15:05 +1100 (AEDT) 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 1a3is3-0005YH-R5; Tue, 01 Dec 2015 11:13:19 +0000 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3ijj-0003fl-Db; Tue, 01 Dec 2015 11:05:06 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 43BE94E8D; Tue, 1 Dec 2015 12:04:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AToulouse-657-1-983-46.w86-217.abo.wanadoo.fr [86.217.137.46]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4F6444E8F; Tue, 1 Dec 2015 12:04:00 +0100 (CET) From: Boris Brezillon To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH v2 25/25] staging: mt29f_spinand: make use of nand_set/get_controller_data() helpers Date: Tue, 1 Dec 2015 12:03:22 +0100 Message-Id: <1448967802-25796-26-git-send-email-boris.brezillon@free-electrons.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448967802-25796-1-git-send-email-boris.brezillon@free-electrons.com> References: <1448967802-25796-1-git-send-email-boris.brezillon@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151201_030444_540203_9DC26AB3 X-CRM114-Status: GOOD ( 14.16 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [37.187.137.238 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Andrew Lunn , Krzysztof Kozlowski , linux-doc@vger.kernel.org, Tony Lindgren , Stefan Agner , linux-sunxi@googlegroups.com, Robert Jarzmik , Alexander Clouter , devel@driverdev.osuosl.org, Boris Brezillon , Jesper Nilsson , linux-samsung-soc@vger.kernel.org, Maxim Levitsky , Jonathan Corbet , Marek Vasut , Chen-Yu Tsai , Kukjin Kim , Ezequiel Garcia , Josh Wu , Sebastian Hesselbarth , Jason Cooper , Wan ZongShun , Steven Miao , adi-buildroot-devel@lists.sourceforge.net, Haojian Zhuang , Mikael Starvik , Krzysztof Halasa , Gregory CLEMENT , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Ryan Mallon , linux-cris-kernel@axis.com, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Hartley Sweeten , Sascha Hauer , Maxime Ripard , Imre Kaloz , Shawn Guo , Daniel Mack MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org New helpers have been added to avoid directly accessing chip->field. Use them where appropriate. Signed-off-by: Boris Brezillon --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index b7d429d..5b3027a 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -32,7 +32,7 @@ static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd) { struct nand_chip *chip = mtd_to_nand(mtd); - struct spinand_info *info = (struct spinand_info *)chip->priv; + struct spinand_info *info = (struct spinand_info *)nand_get_controller_data(chip); struct spinand_state *state = (struct spinand_state *)info->priv; return state; @@ -633,7 +633,7 @@ static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, u8 *p = buf; int eccsize = chip->ecc.size; int eccsteps = chip->ecc.steps; - struct spinand_info *info = (struct spinand_info *)chip->priv; + struct spinand_info *info = (struct spinand_info *)nand_get_controller_data(chip); enable_read_hw_ecc = 1; @@ -679,7 +679,7 @@ static u8 spinand_read_byte(struct mtd_info *mtd) static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip) { - struct spinand_info *info = (struct spinand_info *)chip->priv; + struct spinand_info *info = (struct spinand_info *)nand_get_controller_data(chip); unsigned long timeo = jiffies; int retval, state = chip->state; @@ -745,7 +745,7 @@ static void spinand_cmdfunc(struct mtd_info *mtd, unsigned int command, int column, int page) { struct nand_chip *chip = mtd_to_nand(mtd); - struct spinand_info *info = (struct spinand_info *)chip->priv; + struct spinand_info *info = (struct spinand_info *)nand_get_controller_data(chip); struct spinand_state *state = (struct spinand_state *)info->priv; switch (command) { @@ -894,7 +894,7 @@ static int spinand_probe(struct spi_device *spi_nand) #endif nand_set_flash_node(chip, spi_nand->dev.of_node); - chip->priv = info; + nand_set_controller_data(chip, info); chip->read_buf = spinand_read_buf; chip->write_buf = spinand_write_buf; chip->read_byte = spinand_read_byte;