Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7646949imu; Wed, 14 Nov 2018 22:27:51 -0800 (PST) X-Google-Smtp-Source: AJdET5fAwmk+HMUOSz17XNpNLL8opSL6zVjc0AvYJ7QlyO58l01qSa3iYjjl0Cltfy2DHWtmdLLJ X-Received: by 2002:a17:902:bd0b:: with SMTP id p11-v6mr4978693pls.35.1542263271147; Wed, 14 Nov 2018 22:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542263271; cv=none; d=google.com; s=arc-20160816; b=UorgyLucsW7Srq7/ZJgtEsp5KlJ21OmVybZEmHORZ4LaujkoA2dwcrbHZq08EU6RNz wn59neJUCrXKwmRhEFQHmNptUDdB+uVyhdwhU8wvc3CfJER5oMagIPoUrDhKcuJ0VO0E QYWMAk+SPqzgR0icEmYzeRJgoF2aLvkZEI0gxJRG3fzX5p4bcHv9GLHbEqtGGYHIajmd f0JZFS6xnI/9QIhCHTctGbgYX8TsQEbpuUCNr9hgHeWiBcBZz7xqEb7MxzErHsiVammE zAn6cOB+ftdZQS8Ciq3YkZB3BIoZ0h3oLzQmSO7h2+6t6jmhk8dZuiOdGk7aMHl48Kl2 eHYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=OgvKSAq37dGL5lvbNqnIFovq9rMLBNjmtn+Cx+N1+Sw=; b=YQr5Gp0+dRUFuU1oQ7ixtsnOI406YkhbQJS9pX2C6iP8HYNoVvFMzplBVA0jTmIWTN 8BwkNU1UjDT5mo7DnCI4HiRqb1PnoSkV202dt1rG4Ty7VeUBGlYvQmHsLekdPwmGXG9s QmLVzjUN4vYZkJLCW4m1Bu4SgcrXCmR/vPuDTsz6Dlw1E+cE0F5JShsiULjM5ckUPoMs WPxTZVN9nRXjYzfb62LFyYlYS5XtSLwfCP3iPlYgfbKhI3DiUJUmwbJ0iQDlhY59ryrd 96ojAq7ovZpZg+DV+TcJn/CeilfLTXj19rS3SH2U6G3RR8rQs1tvyoJa3cUJRgiQe1He 9bwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17-v6si5880286pfj.48.2018.11.14.22.27.37; Wed, 14 Nov 2018 22:27:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728748AbeKOQdW (ORCPT + 99 others); Thu, 15 Nov 2018 11:33:22 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:51651 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726574AbeKOQdW (ORCPT ); Thu, 15 Nov 2018 11:33:22 -0500 X-UUID: b600bb10c7f04d44851bcc942b9e6235-20181115 X-UUID: b600bb10c7f04d44851bcc942b9e6235-20181115 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2143731266; Thu, 15 Nov 2018 14:26:44 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 15 Nov 2018 14:26:36 +0800 Received: from mtkslt306.mediatek.inc (10.21.14.136) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 15 Nov 2018 14:26:37 +0800 From: Ryder Lee To: Marek Vasut , Brian Norris , Boris Brezillon CC: Rob Herring , , "Weijie Gao" , Roy Luo , "Guochun Mao" , , , , Subject: [PATCH 2/4] mtd: spi-nor: mtk-quadspi: use ofpart for parsing partitions Date: Thu, 15 Nov 2018 14:26:24 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: <1dc7b27cbad59c413d7076ff7d16b6757014d727.1542262833.git.ryder.lee@mediatek.com> References: <1dc7b27cbad59c413d7076ff7d16b6757014d727.1542262833.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guochun Mao Replace mtd_device_register with mtd_device_parse_register for parsing partitions. Add ofpart support. Signed-off-by: Guochun Mao Tested-by: Ryder Lee --- drivers/mtd/spi-nor/mtk-quadspi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/mtk-quadspi.c b/drivers/mtd/spi-nor/mtk-quadspi.c index 5442993..2278677 100644 --- a/drivers/mtd/spi-nor/mtk-quadspi.c +++ b/drivers/mtd/spi-nor/mtk-quadspi.c @@ -118,6 +118,8 @@ struct mtk_nor { struct clk *nor_clk; }; +static const char * const probes[] = { "ofpart", NULL }; + static void mtk_nor_set_read_mode(struct mtk_nor *mtk_nor) { struct spi_nor *nor = &mtk_nor->nor; @@ -457,7 +459,7 @@ static int mtk_nor_init(struct mtk_nor *mtk_nor, if (ret) return ret; - return mtd_device_register(&nor->mtd, NULL, 0); + return mtd_device_parse_register(&nor->mtd, probes, NULL, NULL, 0); } static int mtk_nor_drv_probe(struct platform_device *pdev) -- 1.9.1